├── demos ├── ponr │ ├── KINGTUT.EQU │ ├── KINGTUT.ERR │ ├── PONR.MAK │ ├── KINGTUT.PAL │ ├── PONR_II.MAK │ ├── KINGTUT.O │ ├── PONR_II.O │ ├── KINGTUT.PIC │ ├── KINGTUT.ASM │ └── PONR_II.ASM ├── kingtut │ ├── kingtut.pal │ ├── kingtut.pic │ ├── show_tut.o │ └── show_tut.asm ├── minidemo │ ├── sprite.mak │ ├── demo01.o │ ├── demo02.o │ ├── demo03.o │ ├── demo04.o │ ├── demo05.o │ ├── sprite.spr │ ├── sprite.sps │ ├── demo01.asm │ └── demo02.asm ├── brk.o ├── raw.o ├── boing.o ├── apfel_2a.o ├── check_ee.o ├── cir_tunn.o ├── demo0006.o ├── drawtest.o ├── fire │ └── fire.o ├── fonttst2.o ├── i2c_test.o ├── irq_test.o ├── lite │ ├── lite.o │ ├── x.pic │ ├── x.spr │ ├── maske.gfa │ ├── maske.pic │ ├── maske.spr │ ├── route.gfa │ ├── spr │ │ ├── backgnd1.spr │ │ └── invaders.spr │ ├── route.dat │ ├── route.lst │ └── maske.sps ├── play_smp.o ├── boing │ └── boing.o ├── demo0006.asm ├── insert │ ├── ATARI.O │ ├── INSERT.O │ └── INSERT.ASM ├── logon │ └── logon.o ├── mines │ ├── mines2.o │ ├── sprites │ │ ├── bombe.o │ │ ├── clock.o │ │ ├── dead.o │ │ ├── fahne.o │ │ ├── gras.o │ │ ├── leer.o │ │ ├── tank.o │ │ ├── bullet.o │ │ ├── bombe.sps │ │ ├── bullet.sps │ │ ├── clock.sps │ │ ├── dead.sps │ │ ├── fahne.sps │ │ ├── gras.sps │ │ ├── leer.sps │ │ └── tank.sps │ └── draw.inc ├── play_smp.lyx ├── playsmp1.lyx ├── playsmp2.lyx ├── sound │ └── sound.o ├── 256col │ ├── 256col.o │ ├── COLORS.DAX │ └── COL_TAB.LST ├── check_24aaxxx.o ├── microfnt │ ├── dump.o │ └── Makefile ├── 256mandl │ ├── 256mandl.o │ └── 256mandl.asm ├── depacker │ ├── depacker.o │ ├── empty.bmp │ ├── empty.spr │ ├── startrek_voyager.spr │ ├── packed_data │ │ ├── empty.pck │ │ ├── empty.spr.lz4 │ │ ├── empty.spr.tsc │ │ ├── empty.spr.zx0 │ │ ├── empty.spr.upkr │ │ ├── empty.spr.exoraw │ │ ├── startrek_voyager.pck │ │ ├── voyager_asteroids.pck │ │ ├── startrek_voyager.spr.exo │ │ ├── startrek_voyager.spr.lz4 │ │ ├── startrek_voyager.spr.tsc │ │ ├── startrek_voyager.spr.upk │ │ ├── startrek_voyager.spr.zx0 │ │ ├── voyager_asteroids.spr.exo │ │ ├── voyager_asteroids.spr.lz4 │ │ ├── voyager_asteroids.spr.tsc │ │ ├── voyager_asteroids.spr.upk │ │ ├── voyager_asteroids.spr.zx0 │ │ ├── startrek_voyager.spr.exoraw │ │ ├── startrek_voyager.spr.upk255 │ │ ├── voyager_asteroids.spr.exoraw │ │ └── voyager_asteroids.spr.upk255 │ ├── voyager_asteroids.spr │ ├── bmp │ │ ├── startrek_voyager.bmp │ │ └── voyager_asteroids.bmp │ ├── startrek_voyager.pal │ ├── voyager_asteroids.pal │ ├── unlz4.var │ ├── untp.var │ ├── untsc.var │ ├── unzx0.var │ ├── unupkr.var │ ├── unupkr_255.var │ ├── unexo.var │ ├── Makefile │ ├── krilldecr.var │ ├── unlz4.asm │ ├── untp.asm │ ├── unzx0.asm │ ├── unlz4_fast.asm │ ├── untsc.asm │ ├── readme.md │ ├── unzx0_fast.asm │ └── unupkr.asm ├── overlay │ ├── overlay.lnx │ ├── Makefile │ ├── Rules.launch │ └── overlay.asm ├── play_smp.mak ├── spriteed │ ├── spriteed.o │ ├── pointer.spr │ ├── spriteed.gfa │ ├── spriteed.spr │ ├── pointer.sps │ ├── spriteed.sps │ └── spriteed.lst ├── Rules.launch ├── brk.asm ├── fonttst2.asm ├── i2c_test.asm ├── raw.asm └── irq_test.asm ├── sendobj.js ├── .gitignore ├── readme.md ├── package.json └── sendobj.js ├── loader.lnx ├── etc ├── LYNX.ROM ├── phobyx1.o ├── PHOBYX1.PAL ├── phobyx_readme.txt └── lynx.info ├── font ├── big.fnt ├── little.fnt ├── small.fnt ├── small2.fnt ├── small_gr.fnt ├── font.doc └── font.txt ├── bin ├── sintab_8.o └── sintab_8.asm ├── microfnt ├── Makefile ├── microfnt.o └── microfnt.equ ├── uloader ├── bll.enc ├── ml.enc ├── ml512.enc ├── bll512.enc ├── allff.lyx.bz2 ├── readme.md ├── demo.s ├── Makefile ├── micro_loader.s └── bll_loader.s ├── includes ├── key.inc ├── input.inc ├── message.inc ├── msg01.inc ├── msg02.inc ├── msg03.inc ├── msg04.inc ├── window.inc ├── window2.inc ├── talktalk.inc ├── draw_spr.inc ├── font2.hlp ├── hexdez.inc ├── random2.inc ├── polygon.inc ├── 1000Hz.inc ├── check_ee.inc ├── savegame.inc ├── depack.inc ├── sample.inc ├── random.inc ├── minihex.inc ├── irq.inc ├── eeprom8.inc └── draw.inc ├── macros ├── font2.mac ├── key.mac ├── cart_header.mac ├── newkey.mac ├── lnx_header.mac ├── newop.mac ├── debug.mac ├── irq.mac ├── sound.mac ├── file.mac ├── microfnt.mac ├── fade.mac ├── suzy.mac ├── window.mac └── overlay.mac ├── uBLL ├── new_bll.lnx ├── new_bll.spr ├── allff.lyx.bz2 ├── new_bll.sps ├── README.md ├── bll_1st_stage.asm ├── Makefile └── bll_2nd_stage.asm ├── vardefs ├── irq.var ├── random.var ├── suzy.var ├── minihex.var ├── sample.var ├── help.var ├── key.var ├── draw.var ├── file.var ├── eeprom.var ├── fpolygon8.var ├── 1000Hz.var ├── message.var ├── mikey.var ├── polygon.var ├── fpolygon.var ├── debug.var ├── msg.var ├── newkey.var ├── talktalk.var ├── serial.var ├── window.var ├── font2.var ├── sound.var └── font.var ├── flash_up.py ├── flashcard.o ├── Makefile └── README.md ├── history ├── README.txt └── Makefile ├── make_lnx └── Makefile ├── lynxenc ├── Makefile ├── sizes.h └── keys.h ├── README.md ├── sendobj.py └── sendobj.py ├── read_regs.py └── read_regs.py └── SendCart.py └── SendCart.py /demos/ponr/KINGTUT.EQU: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demos/ponr/KINGTUT.ERR: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sendobj.js/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /demos/ponr/PONR.MAK: -------------------------------------------------------------------------------- 1 | F:\LYNX\LYNX_ASM\PONR 2 | -------------------------------------------------------------------------------- /demos/kingtut/kingtut.pal: -------------------------------------------------------------------------------- 1 | _00P@SP6 9; -------------------------------------------------------------------------------- /demos/ponr/KINGTUT.PAL: -------------------------------------------------------------------------------- 1 | _00P@SP6 9; -------------------------------------------------------------------------------- /demos/minidemo/sprite.mak: -------------------------------------------------------------------------------- 1 | -v -t2 -c -i007007 -a003003 sprite.sps 2 | -------------------------------------------------------------------------------- /demos/ponr/PONR_II.MAK: -------------------------------------------------------------------------------- 1 | #INTERNAL 2 | #TROYAN 3 | PONR_II.O 4 | KINGTUT.O -------------------------------------------------------------------------------- /loader.lnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/loader.lnx -------------------------------------------------------------------------------- /demos/brk.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/brk.o -------------------------------------------------------------------------------- /demos/raw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/raw.o -------------------------------------------------------------------------------- /etc/LYNX.ROM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/etc/LYNX.ROM -------------------------------------------------------------------------------- /font/big.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/font/big.fnt -------------------------------------------------------------------------------- /bin/sintab_8.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/bin/sintab_8.o -------------------------------------------------------------------------------- /demos/boing.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/boing.o -------------------------------------------------------------------------------- /etc/phobyx1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/etc/phobyx1.o -------------------------------------------------------------------------------- /font/little.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/font/little.fnt -------------------------------------------------------------------------------- /font/small.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/font/small.fnt -------------------------------------------------------------------------------- /font/small2.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/font/small2.fnt -------------------------------------------------------------------------------- /microfnt/Makefile: -------------------------------------------------------------------------------- 1 | #-*-gnu-make-*- 2 | microfnt.o: microfnt.asm 3 | lyxass $< 4 | -------------------------------------------------------------------------------- /uloader/bll.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uloader/bll.enc -------------------------------------------------------------------------------- /uloader/ml.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uloader/ml.enc -------------------------------------------------------------------------------- /demos/apfel_2a.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/apfel_2a.o -------------------------------------------------------------------------------- /demos/check_ee.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/check_ee.o -------------------------------------------------------------------------------- /demos/cir_tunn.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/cir_tunn.o -------------------------------------------------------------------------------- /demos/demo0006.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/demo0006.o -------------------------------------------------------------------------------- /demos/drawtest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/drawtest.o -------------------------------------------------------------------------------- /demos/fire/fire.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/fire/fire.o -------------------------------------------------------------------------------- /demos/fonttst2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/fonttst2.o -------------------------------------------------------------------------------- /demos/i2c_test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/i2c_test.o -------------------------------------------------------------------------------- /demos/irq_test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/irq_test.o -------------------------------------------------------------------------------- /demos/lite/lite.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/lite.o -------------------------------------------------------------------------------- /demos/lite/x.pic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/x.pic -------------------------------------------------------------------------------- /demos/lite/x.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/x.spr -------------------------------------------------------------------------------- /demos/play_smp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/play_smp.o -------------------------------------------------------------------------------- /font/small_gr.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/font/small_gr.fnt -------------------------------------------------------------------------------- /includes/key.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/key.inc -------------------------------------------------------------------------------- /macros/font2.mac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/macros/font2.mac -------------------------------------------------------------------------------- /uBLL/new_bll.lnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uBLL/new_bll.lnx -------------------------------------------------------------------------------- /uBLL/new_bll.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uBLL/new_bll.spr -------------------------------------------------------------------------------- /uloader/ml512.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uloader/ml512.enc -------------------------------------------------------------------------------- /demos/boing/boing.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/boing/boing.o -------------------------------------------------------------------------------- /demos/demo0006.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/demo0006.asm -------------------------------------------------------------------------------- /demos/insert/ATARI.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/insert/ATARI.O -------------------------------------------------------------------------------- /demos/lite/maske.gfa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/maske.gfa -------------------------------------------------------------------------------- /demos/lite/maske.pic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/maske.pic -------------------------------------------------------------------------------- /demos/lite/maske.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/maske.spr -------------------------------------------------------------------------------- /demos/lite/route.gfa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/route.gfa -------------------------------------------------------------------------------- /demos/logon/logon.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/logon/logon.o -------------------------------------------------------------------------------- /demos/mines/mines2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/mines2.o -------------------------------------------------------------------------------- /demos/play_smp.lyx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/play_smp.lyx -------------------------------------------------------------------------------- /demos/playsmp1.lyx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/playsmp1.lyx -------------------------------------------------------------------------------- /demos/playsmp2.lyx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/playsmp2.lyx -------------------------------------------------------------------------------- /demos/ponr/KINGTUT.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/ponr/KINGTUT.O -------------------------------------------------------------------------------- /demos/ponr/PONR_II.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/ponr/PONR_II.O -------------------------------------------------------------------------------- /demos/sound/sound.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/sound/sound.o -------------------------------------------------------------------------------- /includes/input.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/input.inc -------------------------------------------------------------------------------- /includes/message.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/message.inc -------------------------------------------------------------------------------- /includes/msg01.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/msg01.inc -------------------------------------------------------------------------------- /includes/msg02.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/msg02.inc -------------------------------------------------------------------------------- /includes/msg03.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/msg03.inc -------------------------------------------------------------------------------- /includes/msg04.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/msg04.inc -------------------------------------------------------------------------------- /includes/window.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/window.inc -------------------------------------------------------------------------------- /includes/window2.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/window2.inc -------------------------------------------------------------------------------- /microfnt/microfnt.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/microfnt/microfnt.o -------------------------------------------------------------------------------- /uBLL/allff.lyx.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uBLL/allff.lyx.bz2 -------------------------------------------------------------------------------- /uloader/bll512.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uloader/bll512.enc -------------------------------------------------------------------------------- /demos/256col/256col.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/256col/256col.o -------------------------------------------------------------------------------- /demos/check_24aaxxx.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/check_24aaxxx.o -------------------------------------------------------------------------------- /demos/insert/INSERT.O: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/insert/INSERT.O -------------------------------------------------------------------------------- /demos/microfnt/dump.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/microfnt/dump.o -------------------------------------------------------------------------------- /demos/ponr/KINGTUT.PIC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/ponr/KINGTUT.PIC -------------------------------------------------------------------------------- /includes/talktalk.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/includes/talktalk.inc -------------------------------------------------------------------------------- /uloader/allff.lyx.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/uloader/allff.lyx.bz2 -------------------------------------------------------------------------------- /vardefs/irq.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | BEGIN_ZP 3 | IFD BRKuser 4 | BRKvec ds 2 5 | ENDIF 6 | END_ZP 7 | -------------------------------------------------------------------------------- /demos/256col/COLORS.DAX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/256col/COLORS.DAX -------------------------------------------------------------------------------- /demos/256mandl/256mandl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/256mandl/256mandl.o -------------------------------------------------------------------------------- /demos/depacker/depacker.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/depacker.o -------------------------------------------------------------------------------- /demos/depacker/empty.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/empty.bmp -------------------------------------------------------------------------------- /demos/depacker/empty.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/empty.spr -------------------------------------------------------------------------------- /demos/kingtut/kingtut.pic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/kingtut/kingtut.pic -------------------------------------------------------------------------------- /demos/kingtut/show_tut.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/kingtut/show_tut.o -------------------------------------------------------------------------------- /demos/minidemo/demo01.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/minidemo/demo01.o -------------------------------------------------------------------------------- /demos/minidemo/demo02.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/minidemo/demo02.o -------------------------------------------------------------------------------- /demos/minidemo/demo03.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/minidemo/demo03.o -------------------------------------------------------------------------------- /demos/minidemo/demo04.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/minidemo/demo04.o -------------------------------------------------------------------------------- /demos/minidemo/demo05.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/minidemo/demo05.o -------------------------------------------------------------------------------- /demos/minidemo/sprite.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/minidemo/sprite.spr -------------------------------------------------------------------------------- /demos/overlay/overlay.lnx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/overlay/overlay.lnx -------------------------------------------------------------------------------- /demos/play_smp.mak: -------------------------------------------------------------------------------- 1 | #INTERNAL 2 | #TROYAN 3 | insert\INSERT.O 4 | play_smp.o 5 | g:\wav\kissme.lsy 6 | -------------------------------------------------------------------------------- /demos/spriteed/spriteed.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/spriteed/spriteed.o -------------------------------------------------------------------------------- /etc/PHOBYX1.PAL: -------------------------------------------------------------------------------- 1 | phobyx_pal DP 000,574,434,555,656,799,A9A,BCC,DCD,EFF,FAF,695,9B7,7A6,AAB,AC9 2 | -------------------------------------------------------------------------------- /flash_up.py/flashcard.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/flash_up.py/flashcard.o -------------------------------------------------------------------------------- /demos/256mandl/256mandl.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/256mandl/256mandl.asm -------------------------------------------------------------------------------- /demos/lite/spr/backgnd1.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/spr/backgnd1.spr -------------------------------------------------------------------------------- /demos/lite/spr/invaders.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/lite/spr/invaders.spr -------------------------------------------------------------------------------- /demos/mines/sprites/bombe.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/bombe.o -------------------------------------------------------------------------------- /demos/mines/sprites/clock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/clock.o -------------------------------------------------------------------------------- /demos/mines/sprites/dead.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/dead.o -------------------------------------------------------------------------------- /demos/mines/sprites/fahne.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/fahne.o -------------------------------------------------------------------------------- /demos/mines/sprites/gras.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/gras.o -------------------------------------------------------------------------------- /demos/mines/sprites/leer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/leer.o -------------------------------------------------------------------------------- /demos/mines/sprites/tank.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/tank.o -------------------------------------------------------------------------------- /demos/spriteed/pointer.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/spriteed/pointer.spr -------------------------------------------------------------------------------- /demos/spriteed/spriteed.gfa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/spriteed/spriteed.gfa -------------------------------------------------------------------------------- /demos/spriteed/spriteed.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/spriteed/spriteed.spr -------------------------------------------------------------------------------- /history/README.txt: -------------------------------------------------------------------------------- 1 | mikey.asm is the Lynx Boot ROM. 2 | 3 | Disassembled and commented by Alex Thissen. 4 | -------------------------------------------------------------------------------- /demos/mines/sprites/bullet.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/mines/sprites/bullet.o -------------------------------------------------------------------------------- /demos/minidemo/sprite.sps: -------------------------------------------------------------------------------- 1 | 0011100 2 | 0122210 3 | 1233321 4 | 1233321 5 | 1233321 6 | 0122210 7 | 0011100 8 | -------------------------------------------------------------------------------- /etc/phobyx_readme.txt: -------------------------------------------------------------------------------- 1 | The Phobyx logo is (C) 1995 A.-t. of Cream. 2 | Originaly done for the Atari Jaguar. 3 | -------------------------------------------------------------------------------- /history/Makefile: -------------------------------------------------------------------------------- 1 | mikey.rom: mikey.asm 2 | lyxass -d -o $@ mikey.asm 3 | 4 | clean: 5 | rm -f mikey.rom *~ 6 | -------------------------------------------------------------------------------- /vardefs/random.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for RANDOM 3 | BEGIN_ZP 4 | LastRND dw 0 5 | RNDtmp dw 0 6 | END_ZP 7 | -------------------------------------------------------------------------------- /demos/depacker/startrek_voyager.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/startrek_voyager.spr -------------------------------------------------------------------------------- /vardefs/suzy.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; Suzy-vars 3 | BEGIN_ZP 4 | _SPRSYS db 0 5 | Cursor db 0 6 | Button db 0 7 | END_ZP 8 | -------------------------------------------------------------------------------- /demos/depacker/packed_data/empty.pck: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/empty.pck -------------------------------------------------------------------------------- /demos/depacker/voyager_asteroids.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/voyager_asteroids.spr -------------------------------------------------------------------------------- /demos/depacker/bmp/startrek_voyager.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/bmp/startrek_voyager.bmp -------------------------------------------------------------------------------- /demos/depacker/bmp/voyager_asteroids.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/bmp/voyager_asteroids.bmp -------------------------------------------------------------------------------- /demos/depacker/packed_data/empty.spr.lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/empty.spr.lz4 -------------------------------------------------------------------------------- /demos/depacker/packed_data/empty.spr.tsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/empty.spr.tsc -------------------------------------------------------------------------------- /demos/depacker/packed_data/empty.spr.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/empty.spr.zx0 -------------------------------------------------------------------------------- /demos/depacker/packed_data/empty.spr.upkr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/empty.spr.upkr -------------------------------------------------------------------------------- /make_lnx/Makefile: -------------------------------------------------------------------------------- 1 | all: make_lnx 2 | 3 | make_lnx: make_lnx.c 4 | gcc -Os -o $@ $< 5 | 6 | clean: 7 | rm -rf make_lnx make_lnx.exe 8 | -------------------------------------------------------------------------------- /demos/depacker/packed_data/empty.spr.exoraw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/empty.spr.exoraw -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.pck: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.pck -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.pck: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.pck -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.exo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.exo -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.lz4 -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.tsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.tsc -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.upk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.upk -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.zx0 -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.exo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.exo -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.lz4 -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.tsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.tsc -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.upk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.upk -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.zx0 -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.exoraw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.exoraw -------------------------------------------------------------------------------- /demos/depacker/packed_data/startrek_voyager.spr.upk255: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/startrek_voyager.spr.upk255 -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.exoraw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.exoraw -------------------------------------------------------------------------------- /demos/depacker/packed_data/voyager_asteroids.spr.upk255: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/42Bastian/new_bll/HEAD/demos/depacker/packed_data/voyager_asteroids.spr.upk255 -------------------------------------------------------------------------------- /demos/depacker/startrek_voyager.pal: -------------------------------------------------------------------------------- 1 | redir: dc.b $01,$23,$45,$67,$89,$AB,$CD,$EF 2 | pal: DP 000,94C,426,344,224,121,666,112,122,AAA,DBE,C6E,98A,DDD,629,E7F 3 | -------------------------------------------------------------------------------- /demos/depacker/voyager_asteroids.pal: -------------------------------------------------------------------------------- 1 | redir: dc.b $01,$23,$45,$67,$89,$AB,$CD,$EF 2 | pal: DP 010,8A2,453,231,110,342,775,120,CD5,BC4,EED,459,AB9,CDC,897,563 3 | -------------------------------------------------------------------------------- /demos/spriteed/pointer.sps: -------------------------------------------------------------------------------- 1 | 1 2 | 11 3 | 121 4 | 1221 5 | 12221 6 | 122221 7 | 1222221 8 | 12222221 9 | 122222221 10 | 1222111111 11 | 1221 12 | 121 13 | 11 14 | 1 15 | -------------------------------------------------------------------------------- /vardefs/minihex.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for minihex 3 | 4 | BEGIN_ZP 5 | mh_screenBase ds 2 6 | mh_color ds 1 7 | mh_low ds 1 8 | mh_high ds 1 9 | END_ZP 10 | -------------------------------------------------------------------------------- /demos/depacker/unlz4.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; Variable definitions for LZ4 unpacker 3 | 4 | BEGIN_ZP 5 | lz4_src_e DS 2 6 | lz4_tmp DS 1 7 | lz4_ptr DS 2 8 | END_ZP 9 | -------------------------------------------------------------------------------- /demos/mines/sprites/bombe.sps: -------------------------------------------------------------------------------- 1 | 1111111111 2 | 1111111111 3 | 1111133111 4 | 1112311311 5 | 1122111111 6 | 1224211111 7 | 1222211111 8 | 1122111111 9 | 1111111111 10 | 1111111111 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/bullet.sps: -------------------------------------------------------------------------------- 1 | 1111111111 2 | 1111111111 3 | 1111111111 4 | 1441444411 5 | 1444444441 6 | 1144444441 7 | 1444444441 8 | 1441444411 9 | 1111111111 10 | 1111111111 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/clock.sps: -------------------------------------------------------------------------------- 1 | 1111111111 2 | 1122222111 3 | 1233433211 4 | 2333433321 5 | 2333433321 6 | 2333444321 7 | 2333333321 8 | 2333333321 9 | 1233333211 10 | 1122222111 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/dead.sps: -------------------------------------------------------------------------------- 1 | 3333333333 2 | 3131111313 3 | 3313333133 4 | 3312332133 5 | 3313333133 6 | 3331331333 7 | 3313113133 8 | 3133333313 9 | 3333113333 10 | 3333333333 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/fahne.sps: -------------------------------------------------------------------------------- 1 | 1111111111 2 | 1111111111 3 | 1123333311 4 | 1124444411 5 | 1112555551 6 | 1112111111 7 | 1112111111 8 | 1111211111 9 | 1111211111 10 | 1111111111 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/gras.sps: -------------------------------------------------------------------------------- 1 | 1111111111 2 | 1111111111 3 | 1111111111 4 | 1111111111 5 | 1111111111 6 | 1111111111 7 | 1111111111 8 | 1111111111 9 | 1111111111 10 | 1111111111 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/leer.sps: -------------------------------------------------------------------------------- 1 | 2121212121 2 | 1212121212 3 | 2121212121 4 | 1212121212 5 | 2121212121 6 | 1212121212 7 | 2121212121 8 | 1212121212 9 | 2121212121 10 | 1212121212 11 | -------------------------------------------------------------------------------- /demos/mines/sprites/tank.sps: -------------------------------------------------------------------------------- 1 | 1111111111 2 | 1111111111 3 | 1111111111 4 | 1111222222 5 | 1112222111 6 | 1133333311 7 | 1322222231 8 | 1133333311 9 | 1111111111 10 | 1111111111 11 | -------------------------------------------------------------------------------- /vardefs/sample.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | IFND SmpTimer 3 | SmpTimer equ 1 4 | ENDIF 5 | 6 | BEGIN_ZP 7 | SmpSema ds 1 8 | SmpTemp ds 1 9 | SmpTemp2 ds 1 10 | DigiCount ds 3 11 | END_ZP 12 | -------------------------------------------------------------------------------- /demos/depacker/untp.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; Variable definitions for TP unpacker 3 | 4 | BEGIN_ZP 5 | tp_bc DS 1 6 | tp_offset DS 2 7 | tp_end DS 2 8 | tp_token DS 1 9 | END_ZP 10 | -------------------------------------------------------------------------------- /demos/depacker/untsc.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; Variable definitions for TScrunch unpacker 3 | 4 | BEGIN_ZP 5 | tsget DS 2 6 | tstemp DS 1 7 | tsput DS 2 8 | lzput DS 2 9 | END_ZP 10 | -------------------------------------------------------------------------------- /demos/depacker/unzx0.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; Variable definitions for LZ4 unpacker 3 | 4 | BEGIN_ZP 5 | zx0_value DS 2 6 | zx0_bc DS 1 7 | zx0_ptr DS 2 8 | zx0_offset DS 2 9 | zx0_stor DS 1 10 | END_ZP 11 | -------------------------------------------------------------------------------- /demos/ponr/KINGTUT.ASM: -------------------------------------------------------------------------------- 1 | Run $2400 2 | ibytes "kingtut.pal" 3 | db $c1,$10,0 4 | dw 0 5 | dw kingtut 6 | dw 35,5 7 | dw $100,$100 8 | db $01,$23,$45,$67 9 | db $89,$ab,$cd,$ef 10 | kingtut ibytes "kingtut.pic" 11 | -------------------------------------------------------------------------------- /vardefs/help.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | * 3 | * just three temp-registers ;) 4 | * 5 | BEGIN_ZP 6 | temp:: ds 2 7 | temp1:: ds 2 8 | temp2:: ds 2 9 | END_ZP 10 | 11 | tmp0 equ temp 12 | tmp1 equ temp1 13 | tmp2 equ temp2 -------------------------------------------------------------------------------- /demos/microfnt/Makefile: -------------------------------------------------------------------------------- 1 | DEMO=dump 2 | 3 | dump.o: dump.asm $(BLL_ROOT)/microfnt/microfnt.o 4 | lyxass -v dump.asm 5 | 6 | $(BLL_ROOT)/microfnt/microfnt.o: 7 | make -C $(BLL_ROOT)/microfnt 8 | 9 | include ../Rules.launch 10 | -------------------------------------------------------------------------------- /vardefs/key.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; BSS-variables KEY 3 | ; 23.6.93 4 | 5 | 6 | BEGIN_ZP 7 | KeyCounter ds 2 8 | LastButton ds 1 9 | LastCursor ds 1 10 | PauseEnable ds 1 11 | PauseFlag ds 1 12 | PausePtr ds 4 13 | END_ZP 14 | -------------------------------------------------------------------------------- /uBLL/new_bll.sps: -------------------------------------------------------------------------------- 1 | 111 11 11111 11 11 1111 11 11000 2 | 1111 11 11 11 11 11 11 11 11000 3 | 11 11 11 1111 11 11 11 1111 11 11000 4 | 11 1111 11 11 11 11 11 11 11 11000 5 | 11 111 11111 111111 1111 11111 11111 -------------------------------------------------------------------------------- /vardefs/draw.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for DRAW.INC 3 | BEGIN_ZP 4 | IFND x1 5 | x1 ds 2 6 | y1 ds 2 7 | x2 ds 2 8 | y2 ds 2 9 | x3 ds 2 10 | y3 ds 2 11 | ENDIF 12 | END_ZP 13 | -------------------------------------------------------------------------------- /vardefs/file.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for FILE.INC 3 | 4 | BEGIN_ZP 5 | CurrBlock ds 1 6 | IF BlockSize>255 7 | BlockByte ds 2 8 | ELSE 9 | BlockByte ds 1 10 | ENDIF 11 | 12 | entry ds DirEntry.LEN ; space for current entry 13 | DestPtr dw 0 14 | END_ZP 15 | -------------------------------------------------------------------------------- /demos/depacker/unupkr.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | BEGIN_ZP 3 | upkr_state DS 3 4 | upkr_value DS 2 5 | upkr_ptr DS 2 6 | upkr_probs DS 2 7 | upkr_offset DS 2 8 | upkr_pwm DS 1 9 | 10 | END_ZP 11 | 12 | BEGIN_MEM 13 | upkr_probs_array DS 1+255+2*32+2*32 14 | END_MEM 15 | -------------------------------------------------------------------------------- /demos/depacker/unupkr_255.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | BEGIN_ZP 3 | upkr_state DS 3 4 | upkr_ptr DS 2 5 | upkr_probs DS 2 6 | upkr_value DS 1 7 | upkr_pwm DS 1 8 | upkr_tmp DS 1 9 | 10 | END_ZP 11 | 12 | BEGIN_MEM 13 | upkr_probs_array DS 1+255+2*32+2*32 14 | END_MEM 15 | -------------------------------------------------------------------------------- /uBLL/README.md: -------------------------------------------------------------------------------- 1 | # uBLL 2 | 3 | BLL uploader for the bootsector using only 1 encrypted block. 4 | Uploader is placed in the stack, so it can load from $200 up. 5 | 6 | It defaults now to 1MBd (UARTturbo in Mtest0 => MichelS). 7 | If a button is pressed on startup it uses 62500Bd. 8 | -------------------------------------------------------------------------------- /vardefs/eeprom.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | **************** 3 | * ZP-vars of EEPROM 4 | * created : 11.5.95 5 | * modified : 6 | * 7 | * 16.02.96 removed I2Cbyte (not needed anymore) 8 | * 9 | * (c) 1995 Bastian Schick 10 | **************** 11 | BEGIN_ZP 12 | I2Cword ds 2 13 | END_ZP 14 | -------------------------------------------------------------------------------- /vardefs/fpolygon8.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; ZP variables for fpolygon8.inc 3 | BEGIN_ZP 4 | px1 ds 1 5 | px2 ds 1 6 | px3 ds 1 7 | py1 ds 1 8 | py2 ds 1 9 | py3 ds 1 10 | IFND tiltAB 11 | tiltAB ds 2 12 | tiltAC EQU temp1 13 | tiltBC EQU temp2 14 | ENDIF 15 | END_ZP 16 | -------------------------------------------------------------------------------- /vardefs/1000Hz.var: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | * _1000Hz.var 3 | * (c) 1994 Bastian Schick 4 | * last change : 5 | * 25.04.96 BS to English 6 | * 7 | BEGIN_ZP 8 | milli ds 2 9 | _1000Hz ds 3 10 | seconds ds 1 11 | minutes ds 1 12 | hours ds 1 13 | IFD FlipUser 14 | FlipFlag ds 1 15 | ENDIF 16 | END_ZP 17 | -------------------------------------------------------------------------------- /flash_up.py/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-Os -fomit-frame-pointer 2 | 3 | .SUFFIXES: .asc .obj .S .asm 4 | 5 | %.o: %.asm 6 | lyxass $< 7 | 8 | .obj.asc: 9 | bin2asc < $*.obj >$@ 10 | 11 | %.o: %.c 12 | $(CC) $(CFLAGS) -c $< 13 | %.o: %.S 14 | $(CC) -c $< -o $@ 15 | 16 | all: flashcard.o 17 | 18 | clean: 19 | rm -f *.o 20 | rm -f *~ 21 | -------------------------------------------------------------------------------- /vardefs/message.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ****************************** 3 | * MESSAGE 4 | * (c) 1994 Bastian Schick 5 | * modified: 6 | * 06.05.96 BS -> English 7 | ****************************** 8 | 9 | MAX_PLAYER equ 16 10 | GOON equ $31 11 | 12 | BEGIN_ZP 13 | player_id ds MAX_PLAYER 14 | my_id ds 1 15 | num_players ds 1 16 | END_ZP 17 | -------------------------------------------------------------------------------- /vardefs/mikey.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for MIKEY 3 | 4 | BEGIN_ZP 5 | ScreenBase dw 0 6 | ScreenBase2 dw 0 7 | COMLYNXCntrl db 0 8 | _IOdat db 0 9 | _IOdir db 0 10 | _VIDEODMA 11 | _DISPCTL db 0 ; two names ;) 12 | IFD IRQ_SWITCHBUF_USR 13 | SWITCHFlag db 0 14 | ENDIF 15 | END_ZP 16 | -------------------------------------------------------------------------------- /vardefs/polygon.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for DRAW.INC 3 | BEGIN_ZP 4 | x1 ds 2 5 | y1 ds 2 6 | x2 ds 2 7 | y2 ds 2 8 | x3 ds 2 9 | y3 ds 2 10 | 11 | ax ds 2 12 | ay ds 2 13 | bx ds 2 14 | by ds 2 15 | END_ZP 16 | -------------------------------------------------------------------------------- /vardefs/fpolygon.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ; vars for FPOLYGON 3 | BEGIN_ZP 4 | tiltAB ds 2 5 | tiltAC equ temp1 6 | tiltBC equ temp2 7 | IFND x1 8 | x1 ds 2 9 | y1 ds 2 10 | x2 ds 2 11 | y2 ds 2 12 | x3 ds 2 13 | y3 ds 2 14 | ENDIF 15 | END_ZP 16 | -------------------------------------------------------------------------------- /includes/draw_spr.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | IFND DrawSprite 3 | *************** 4 | * draw a single Sprite 5 | *************** 6 | DrawSprite:: 7 | pha 8 | sta SCBNEXT 9 | sty SCBNEXT+1 10 | MOVE ScreenBase,VIDBAS 11 | lda #1 12 | STA SPRGO 13 | STZ SDONEACK 14 | .WAIT STZ CPUSLEEP 15 | bit SPRSYS 16 | bne .WAIT 17 | STZ SDONEACK 18 | pla 19 | rts 20 | ENDIF 21 | -------------------------------------------------------------------------------- /microfnt/microfnt.equ: -------------------------------------------------------------------------------- 1 | MFNT_char_x EQU $F882 2 | MFNT_char_y EQU $F883 3 | MFNT_PrintStringXY EQU $F9AE 4 | MFNT_PrintChar EQU $FA17 5 | MFNT_PrintString EQU $F9B4 6 | MFNT_PrintHexXY EQU $F9E6 7 | fontPAL EQU $F860 8 | MFNT_screenbase EQU $F880 9 | MFNT_PrintHex EQU $F9EC 10 | MFNT_PrintCharXY EQU $FA11 11 | charDatahi EQU $F982 12 | charDatalo EQU $F956 13 | -------------------------------------------------------------------------------- /macros/key.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | _PAUSE equ %00001 3 | _FIREA equ %00010 4 | _FIREB equ %00100 5 | _OPT2 equ %01000 6 | _OPT1 equ %10000 7 | 8 | _RESTART equ _PAUSE+_OPT1 9 | _FLIP equ _PAUSE+_OPT2 10 | ;--------------- 11 | MACRO SET_KEYCOUNTER 12 | lda #$ff-(<(\0)) 13 | sta KeyCounter 14 | lda #$ff-(>(\0)) 15 | sta KeyCounter+1 16 | ENDM 17 | 18 | MACRO INITKEY 19 | jsr InitKey 20 | ENDM 21 | -------------------------------------------------------------------------------- /vardefs/debug.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for DEBUG 3 | 4 | BEGIN_ZP 5 | IFD BRKuser 6 | EnterBRK ds 1 ; pha 7 | ds 2 ; lda #$C 8 | ds 3 ; sta $fff9 9 | ds 3 ; jmp BRKserver 10 | ENDIF 11 | DebugEnable ds 1 ; = 0 => Debug possible 12 | DebugFlag ds 1 13 | DebugPtr ds 2 14 | END_ZP 15 | -------------------------------------------------------------------------------- /flash_up.py/README.md: -------------------------------------------------------------------------------- 1 | # flash_up.py 2 | 3 | A Flasher for Karri's Flash cards. Needs no external hardware. 4 | 5 | Can also dump cards. 6 | 7 | ``` 8 | -b - Baudrate 9 | -p - port 10 | -g - Get block CRCs 11 | -s - Block size 512,1024 or 2048 12 | -e - erase entire flash 13 | -l - force loading of flashcard.o 14 | -x - flash all blocks no matter if CRCs are identical 15 | -f - flash file 16 | -r - dump file 17 | ``` 18 | -------------------------------------------------------------------------------- /sendobj.js/readme.md: -------------------------------------------------------------------------------- 1 | # Sendobj 2 | 3 | Send BLL files via UART/ComLynx 4 | 5 | ## Install 6 | 7 | You should have node.js and npm installed, then do 8 | 9 | `npm install` 10 | 11 | to load dependencies. 12 | 13 | ## Usage 14 | 15 | `node sendobj.js [-b ] [-p port] filename` 16 | 17 | Default values are COM7 and 62500Bd 18 | 19 | On Linux you might have to prepend `sudo` depending on the rights of the serial device. 20 | -------------------------------------------------------------------------------- /demos/overlay/Makefile: -------------------------------------------------------------------------------- 1 | DEMO=overlay 2 | DEMO_EXT= 3 | INC= 4 | 5 | $(DEMO).lnx: $(DEMO).asm 6 | 7 | $(DEMO).bin $(DEMO).o: $(INC) 8 | 9 | %.o: %.asm 10 | lyxass -v $(ASFLAGS) $< 11 | 12 | .PHONY: lnx 13 | lnx: $(DEMO)$(DEMO_EXT).lnx 14 | 15 | $(DEMO)$(DEMO_EXT).lnx: $(DEMO).asm $(INC) 16 | lyxass -sh -d $(ASFLAGS) -D LNX=1 -o $@ $(DEMO).asm 17 | 18 | include Rules.launch 19 | 20 | clean: 21 | @rm -f *~ *.equ 22 | 23 | real-clean: clean 24 | @rm -f *.lnx 25 | -------------------------------------------------------------------------------- /lynxenc/Makefile: -------------------------------------------------------------------------------- 1 | OS=$(shell uname) 2 | ifeq ($(OS),Darwin) 3 | INC=-I/opt/homebrew/include 4 | LIB=-L/opt/homebrew/lib 5 | else 6 | INC=-I/usr/local/ssl/include 7 | LIB=-L/usr/local/ssl/lib 8 | endif 9 | LIB += -lssl -lcrypto 10 | 11 | all: lynxdec lynxenc 12 | 13 | lynxdec: lynxdec.c sizes.h keys.h 14 | gcc $(INC) -g -O0 lynxdec.c -o lynxdec $(LIB) 15 | 16 | lynxenc: lynxenc.c sizes.h keys.h 17 | gcc $(INC) -g -O0 lynxenc.c -o lynxenc $(LIB) 18 | 19 | clean: 20 | rm -rf lynxdec 21 | rm -rf lynxenc 22 | rm -rf *.dSYM 23 | -------------------------------------------------------------------------------- /demos/depacker/unexo.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; Variable definitions for exomizer unpacker 3 | 4 | ;; if flag is 1, set exomizer flag in comment for compressing 5 | NO_LIT_SEQ EQU 1 ; -c 6 | NO_OFFSET_REUSE EQU 1 ; -P-32 7 | NO_1BYTE_SEQ EQU 0 ; -T2 8 | 9 | BEGIN_ZP 10 | exo_bitbuf DS 1 11 | exo_ptr DS 2 12 | exo_offset DS 2 13 | exo_value DS 2 14 | exo_len DS 2 15 | IF NO_OFFSET_REUSE = 0 16 | exo_reuse DS 1 17 | ENDIF 18 | END_ZP 19 | 20 | BEGIN_MEM 21 | exo_base DS 52*2 22 | exo_bits DS 52 23 | END_MEM 24 | -------------------------------------------------------------------------------- /uBLL/bll_1st_stage.asm: -------------------------------------------------------------------------------- 1 | *************** 2 | * Mini COMLynx Loader (not size optimized) 3 | * First stage 4 | **************** 5 | 6 | include 7 | 8 | Baudrate EQU 62500 9 | 10 | run $200 11 | Start:: 12 | ldy RCART0 13 | ldx #$ff 14 | txs 15 | .read2nd: 16 | inx 17 | lda RCART0 18 | sta $100,x 19 | dey 20 | bne .read2nd 21 | jmp $100 22 | End: 23 | 24 | size set End-Start 25 | free set 49-size 26 | 27 | IF free > 0 28 | REPT free 29 | dc.b $0 30 | ENDR 31 | ENDIF 32 | dc.b 0 33 | echo "Size:%dsize Free:%dfree" 34 | -------------------------------------------------------------------------------- /vardefs/msg.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for MSG 3 | ; 97/08/13 42BS commented out all tx-irq stuff 4 | ; 07/08/21 42BS deleted all tx-irq stuff 5 | 6 | IFND MSG_SIZE 7 | MSG_SIZE EQU 8 8 | ENDIF 9 | 10 | RxParityErr equ %00010000 11 | RxOverrun equ %00001000 12 | RxFrameErr equ %00000100 13 | RxBreak equ %00000010 14 | 15 | BEGIN_ZP 16 | RxPtrIn ds 1 17 | RxDone ds 1 18 | 19 | SerialStat ds 1 ; ComLynx-Errors $FD8C(r) 20 | END_ZP 21 | 22 | BEGIN_MEM 23 | TxBuffer ds MSG_SIZE 24 | RxBuffer ds MSG_SIZE 25 | END_MEM 26 | -------------------------------------------------------------------------------- /includes/font2.hlp: -------------------------------------------------------------------------------- 1 | ;*************** 2 | ;* loads fonts 3 | ;* !! place at very end 4 | ;*************** 5 | align 2 ; Ladeadresse gerade 6 | BigFnt IF BIGFNTuser 7 | ibytes 8 | ELSE 9 | dw 0 10 | ENDIF 11 | align 2 12 | LittleFnt IF LITTLEFNTuser 13 | ibytes 14 | ELSE 15 | dw 0 16 | ENDIF 17 | align 2 18 | SmallFnt IF SMALLFNTuser 19 | ibytes 20 | ELSE 21 | dw 0 22 | endif 23 | align 2 24 | SmallFnt2 IF SMALLFNT2user 25 | ibytes 26 | ELSE 27 | dw 0 28 | ENDIF 29 | align 2 30 | LittleFnt2 IF LITTLEFNT2user 31 | ibytes 32 | ELSE 33 | dw 0 34 | ENDIF 35 | 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # new_bll 2 | 3 | This is "fork" of the original BLL to start moving it to the 21th century. 4 | 5 | # Tools 6 | 7 | ## lyxass 8 | 9 | https://github.com/42Bastian/lyxass 10 | 11 | ## sprpck 12 | 13 | https://github.com/42Bastian/sprpck 14 | 15 | ## make_lnx 16 | 17 | See folder make_lnx, build with any gcc 18 | 19 | ## lynxenc 20 | 21 | See folder lynxenc. Builds with any gcc but needs crypto and ssl libraries. 22 | 23 | # Demos 24 | 25 | More complex demos are here: 26 | 27 | https://github.com/42Bastian/lynx_hacking 28 | 29 | 30 | # (C) 31 | ------------------------------------------------- 32 | (c) 2019 42Bastian Schick if not otherwise noted. 33 | ------------------------------------------------- 34 | -------------------------------------------------------------------------------- /sendobj.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sendobj", 3 | "version": "1.0.0", 4 | "description": "BLL sendobj", 5 | "main": "sendobj.js", 6 | "scripts": { 7 | "start": "node . ", 8 | "install": "npm rebuild" 9 | }, 10 | "keywords": [ 11 | "BLL", 12 | "sendobj" 13 | ], 14 | "author": "42Bastian", 15 | "license": "CC0-1.0", 16 | "dependencies": { 17 | "serialport": "^9.2.8", 18 | "simple-get": ">=4.0.1" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/42Bastian/new_bll/tree/master/sendobj.js" 23 | }, 24 | "devDependencies": { 25 | "why-is-node-running": "^2.2.2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /macros/cart_header.mac: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; 3 | ;;; Game cartridge header 4 | ;;; 5 | ;;; Expects labels End and Start. 6 | ;;; 7 | 8 | IFND BlockSize 9 | echo "Need to define BlockSize (1024 or 2048). Defaulting to 1024" 10 | BlockSize equ 1024 11 | ENDIF 12 | MACRO CART_HEADER ; name, manufacture, rotation eeprom 13 | run 0 14 | LNX_HEADER BlockSize,0,\0,\1,\2,\3 15 | 16 | run 0 17 | SWITCH BlockSize 18 | CASE 1024 19 | ibytes 20 | CASE 2048 21 | ibytes 22 | ELSES 23 | echo "Wrong blocksize %dBlockSize" 24 | error 25 | ENDS 26 | size_of_loader: 27 | run $1ff 28 | ; number of pages to load (must by 1st byte!!!) 29 | dc.b 1+((End-Start)>>8) 30 | 31 | ROM_PC set size_of_loader 32 | ENDM 33 | -------------------------------------------------------------------------------- /vardefs/newkey.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | * NewKey.Var 3 | * 4 | * created : 28.03.96 5 | * 6 | * last modified : 7 | * 8 | * 31.03.96 Keybuffer included 9 | * 10 | * 11 | * * Enable*Repeat : 12 | * a set bit enable repeat for that key 13 | * 14 | 15 | BEGIN_ZP 16 | DelayCursor ds 1 17 | RepeatCursor ds 1 18 | DelayButton ds 1 19 | RepeatButton ds 1 20 | EnableCursorRepeat 21 | ds 1 22 | EnableButtonRepeat 23 | ds 1 24 | 25 | LastButton ds 1 26 | LastCursor ds 1 27 | CurrentButton ds 1 ; last key outa buffer 28 | CurrentCursor ds 1 29 | KeyPtrIn ds 1 30 | KeyPtrOut ds 1 31 | 32 | PauseEnable ds 1 33 | PauseFlag ds 1 34 | PausePtr ds 4 35 | END_ZP 36 | 37 | BEGIN_MEM 38 | KeyBuffer ds 8 ; button-buffer 39 | ds 8 ; cursor-buffer 40 | END_MEM 41 | -------------------------------------------------------------------------------- /vardefs/talktalk.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ************************* 3 | * TALKTALK-vars 4 | * (c) 1994 Bastian Schick 5 | * created : 290694 6 | * modified 7 | * 06.05.96 BS -> English 8 | ************************ 9 | IFND MessageBufferLen 10 | MessageBufferLen equ 10 11 | ENDIF 12 | 13 | BEGIN_ZP 14 | MessagePtrIn ds 1 15 | MessagePtrOut ds 1 16 | MessageLenIn ds 1 17 | MessageLenOut ds 1 18 | MessageReceived ds 1 19 | MessageDone ds 1 20 | FirstByteIn ds 1 21 | 22 | SerialContrl ds 1 23 | SerialTimeOut ds 1 24 | SerialStat ds 1 25 | TimeOutFlag ds 1 26 | 27 | CheckInFlag ds 1 28 | CheckIn ds 1 29 | CheckOutFlag ds 1 30 | END_ZP 31 | 32 | BEGIN_MEM 33 | MessageBufferIn ds MessageBufferLen 34 | MessageBufferOut ds MessageBufferLen 35 | END_MEM 36 | -------------------------------------------------------------------------------- /includes/hexdez.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | **************** 3 | PrintHex:: phx 4 | pha 5 | lsr 6 | lsr 7 | lsr 8 | lsr 9 | tax 10 | lda digits,x 11 | jsr PrintChar 12 | pla 13 | and #$f 14 | tax 15 | lda digits,x 16 | jsr PrintChar 17 | plx 18 | rts 19 | digits db "0123456789ABCDEF" 20 | **************** 21 | * IN : A 22 | PrintDezA:: 23 | PrintDecA:: 24 | **************** 25 | phx 26 | phy 27 | pha 28 | ldy #"0"-1 29 | .loop1 iny 30 | sec 31 | sbc #100 32 | bcs .loop1 33 | adc #100 34 | 35 | ldx #"0"-1 36 | .loop2 inx 37 | sec 38 | sbc #10 39 | bcs .loop2 40 | adc #10 41 | clc 42 | adc #"0" 43 | pha 44 | tya 45 | jsr PrintChar 46 | txa 47 | jsr PrintChar 48 | pla 49 | jsr PrintChar 50 | pla 51 | ply 52 | plx 53 | rts 54 | -------------------------------------------------------------------------------- /macros/newkey.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | * NewKey.mac 3 | * 4 | * created : 28.03.96 5 | * 6 | * (c) Bastian Schick 7 | * 8 | * last modified : 9 | * 10 | * 04.05.96 BS include EQUs for cursor-buttons 11 | NEWKEY set 1 12 | 13 | _PAUSE equ %00001 14 | _FIREA equ %00010 15 | _FIREB equ %00100 16 | _OPT2 equ %01000 17 | _OPT1 equ %10000 18 | 19 | _RESTART equ _PAUSE+_OPT1 20 | _FLIP equ _PAUSE+_OPT2 21 | 22 | _UP equ %10000000 23 | _DOWN equ %01000000 24 | _LEFT equ %00100000 25 | _RIGHT equ %00010000 26 | 27 | ;--------------- 28 | 29 | MACRO INITKEY 30 | IFVAR \0 31 | lda #\0 32 | ELSE 33 | lda #$f0 34 | ENDIF 35 | sta EnableCursorRepeat 36 | IFVAR \1 37 | lda #\1 38 | ELSE 39 | lda #$1f 40 | ENDIF 41 | sta EnableButtonRepeat 42 | jsr InitKey 43 | ENDM 44 | -------------------------------------------------------------------------------- /demos/depacker/Makefile: -------------------------------------------------------------------------------- 1 | DEMO=depacker 2 | 3 | $(DEMO).o: $(DEMO).asm 4 | 5 | ifeq ($(HANDY),1) 6 | ASFLAGS=-D HANDY=1 7 | endif 8 | 9 | %.o: %.asm 10 | lyxass -v $(ASFLAGS) $< 11 | 12 | %.bin: %.asm 13 | lyxass -d $(ASFLAGS) -D LNX=1 -o $@ $< 14 | 15 | $(DEMO).o: unlz4.asm unzx0.asm untp.asm unlz4_fast.asm unzx0_fast.asm \ 16 | krilldecr.inc krilldecr.var unupkr.var unupkr.asm\ 17 | unupkr_255.var unupkr_255.asm unexo.asm unexo.var \ 18 | untsc.asm untsc.var 19 | 20 | .PHONY: lnx 21 | lnx: $(DEMO).bin 22 | lynxenc $< $(DEMO).lyx 23 | bzcat allff.lyx.bz2 >> $(DEMO).lyx 24 | make_lnx $(DEMO).lyx -b0 256K -o $(DEMO).lnx 25 | @echo 26 | 27 | .PHONY: clean 28 | clean: 29 | rm -f *.lyx *~ *.bin *.o 30 | 31 | include ../Rules.launch 32 | -------------------------------------------------------------------------------- /vardefs/serial.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; vars for SERIAL 3 | 4 | IFND TxBufferSize 5 | TxBufferSize equ 256 6 | RxBufferSize equ 256 7 | TimeOutTimer equ 7 8 | ENDIF 9 | 10 | RxParityErr equ %00010000 11 | RxOverrun equ %00001000 12 | RxFrameErr equ %00000100 13 | RxBreak equ %00000010 14 | 15 | BEGIN_ZP 16 | TxPtrIn ds 1 17 | TxPtrOut ds 1 18 | RxPtrIn ds 1 19 | RxPtrOut ds 1 20 | 21 | LastSerialStat ds 1 22 | SerialStat ds 1 ; ComLynx-Errors $FD8C(r) 23 | SerialContrl ds 1 ; copy of $FD8C(w) 24 | TimeOutFlag ds 1 ; <0 => TimeOut 25 | TxDone ds 1 ; <0 last char send 26 | SerialLastRxTime ds 2 ; time of last char received 27 | SerialTimeOut ds 1 ; time for TimeOut 28 | END_ZP 29 | 30 | BEGIN_MEM 31 | TxBuffer ds TxBufferSize 32 | RxBuffer ds RxBufferSize 33 | END_MEM 34 | -------------------------------------------------------------------------------- /demos/lite/route.dat: -------------------------------------------------------------------------------- 1 | route_x dc.b 8,0,5,10,15,20,25,30,35,41,46,51,56,61,66,71, 2 | dc.b 81,86,91,96,101,106,112,117,119,114,109,104,99,94,89,84, 3 | dc.b 74,69,64,59,54,49,45,43,40,38,36,35,36,37,41,46, 4 | dc.b 56,61,66,71,76,81,86,91,96,101,106,111,116,121,126,130, 5 | dc.b 134,136,137,138,139,139,138,136,133,128,123,118,113,108,103,98, 6 | dc.b 88,83,78,72,67,64,61,59,57,55,53,52,51,50,49,48, 7 | dc.b 40,35,30,25,20,15,route_y dc.b 8,0,3,6,9,12,15,19,22,25,28,31,35,38,41,44, 8 | dc.b 50,54,57,60,63,66,70,74,79,84,86,87,88,89,89,90, 9 | dc.b 90,89,88,87,84,80,75,70,65,60,54,49,44,39,34,30, 10 | dc.b 24,22,20,19,17,16,15,14,13,12,12,11,11,13,16,21, 11 | dc.b 31,36,41,46,51,56,61,66,71,75,78,80,81,82,83,84, 12 | dc.b 85,85,84,82,78,73,68,63,58,53,48,43,38,33,27,22, 13 | dc.b 13,10,9,8,7,6, -------------------------------------------------------------------------------- /demos/256col/COL_TAB.LST: -------------------------------------------------------------------------------- 1 | DEFINT "a-z" 2 | color=0 3 | CLR c 4 | OPEN "o",#1,"f:\colors.dat" 5 | FOR col=0 TO 15 6 | OUT #1,255 7 | add=1 8 | CLR col1 9 | FOR blocks=0 TO 99 10 | co=SHL(col1,4) OR col 11 | OUT #1,SHR(co,8) AND 255 12 | ADD col1,add 13 | IF col1=15 OR col1=0 14 | add=-add 15 | ENDIF 16 | NEXT blocks 17 | OUT #1,RANDOM(255) 18 | FOR i=1 TO 256-102 19 | OUT #1,0 20 | NEXT i 21 | NEXT col 22 | FOR col=0 TO 15 23 | OUT #1,255 24 | add=1 25 | CLR col1 26 | FOR blocks=0 TO 99 27 | co=SHL(col1,4) OR col 28 | OUT #1,co AND 255 29 | ADD col1,add 30 | IF col1=15 OR col1=0 31 | add=-add 32 | ENDIF 33 | NEXT blocks 34 | OUT #1,RANDOM(255) 35 | FOR i=1 TO 256-102 36 | OUT #1,0 37 | NEXT i 38 | NEXT col 39 | CLOSE #1 40 | -------------------------------------------------------------------------------- /includes/random2.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | * RANDOM2.INC 3 | * 4 | * Offered by Rob Nicholson. 5 | * It works great _and_ is fast ! 6 | * 7 | * 8 | * Random 9 | random_seed dc.w 0 10 | last_random dc.b 35 11 | 12 | Random 13 | InitRandom:: phx 14 | lda random_seed+1 ; havn't a clue what this does 15 | tax 16 | eor #$80 17 | rol 18 | rol random_seed+2 19 | ror random_seed+1 20 | lda random_seed 21 | sta random_seed+1 22 | 23 | ror 24 | eor random_seed+2 25 | stx random_seed+2 26 | sta random_seed 27 | plx ; restore X 28 | rts 29 | * 30 | -------------------------------------------------------------------------------- /demos/spriteed/spriteed.sps: -------------------------------------------------------------------------------- 1 | 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 2 | 1 1 1 1 1 3 | 1 222 2 2222 222 2222 1 222 2 2 2 2 1 222 2222 2 2 222 1 222 2222 22222 1 4 | 1 2 2 2 2 2 2 2 2 1 2 22 2 2 2 1 2 2 22 2 2 2 1 2 2 2 1 5 | 1 2 2 222 22222 2222 1 2 2 2 2 2 2 1 22 222 2 2 2 2 2 1 2 222 222 2 1 6 | 1 2 2 2 2 2 2 2 2 1 2 2 22 2 2 1 2 2 2 22 2 2 1 2 2 2 2 1 7 | 1 222 2222 2222 2 2 2 2 1 222 2 2 2 1 222 2222 2 2 222 1 222 2222 2 1 8 | 1 1 1 1 1 9 | 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 10 | -------------------------------------------------------------------------------- /demos/ponr/PONR_II.ASM: -------------------------------------------------------------------------------- 1 | 2 | Run $2400 3 | 4 | ibytes "kingtut.pal" 5 | CLS db $01,$90,$00 6 | dw KINGTUT0,cls 7 | cls_x dw 0 8 | cls_y dw 0 9 | dw 160*256,102*256 10 | db $00 11 | cls db 2,00,0 12 | kingtut ibytes "kingtut.pic" 13 | 14 | KINGTUT0 db $C1,$10,$00 15 | dw KINGTUT1,kingtut 16 | dw 80,52,0,0 17 | db $01,$23,$45,$67,$89,$ab,$cd,$ef 18 | 19 | size set 1 20 | x set 79 21 | y set 51 22 | count set 5 23 | KINGTUT1 24 | REPT 511 25 | db $c1,$18,$00 26 | dw *+12,kingtut 27 | dw x,y,size,size 28 | size set size+1 29 | count set count-1 30 | IF count=0 31 | x set x-1 32 | y set y-1 33 | count set 5 34 | ENDIF 35 | ENDR 36 | 37 | REPT 511 38 | db $c1,$18,$00 39 | dw *+12,kingtut 40 | dw x,y,size,size 41 | size set size-1 42 | count set count-1 43 | IF count=0 44 | x set x+1 45 | y set y+1 46 | count set 5 47 | ENDIF 48 | ENDR 49 | 50 | 51 | KINGTUT1024 db $C1,$18,$00 52 | dw KINGTUT1,kingtut 53 | dw 80,52,0,0 54 | -------------------------------------------------------------------------------- /macros/lnx_header.mac: -------------------------------------------------------------------------------- 1 | ;;; -*-asm-*- 2 | ;;; Macro to set the LNX header 3 | ;;; 4 | 5 | PAGESIZE_512 equ 512 6 | PAGESIZE_1024 equ 1024 7 | PAGESIZE_2048 equ 2048 8 | 9 | ;;->typedef struct 10 | ;;->{ 11 | ;;-> UBYTE magic[4]; 12 | ;;-> UWORD page_size_bank0; 13 | ;;-> UWORD page_size_bank1; 14 | ;;-> UWORD version; 15 | ;;-> char cartname[32]; 16 | ;;-> char manufname[16]; 17 | ;;-> char rotation; 18 | ;;-> char audBit 19 | ;;-> char eeprom 20 | ;;-> UBYTE spare[3]; 21 | ;;->}LYNX_HEADER_NEW; 22 | 23 | MACRO LNX_HEADER ; pagesize0, pagesize1, cartname, manufname, rotation,eeprom 24 | dc.b "LYNX" 25 | dc.w \0 ; page_size_bank0 26 | dc.w \1 ; page_size_bank1 27 | dc.w 1 ; version 28 | .\_0 29 | dc.b \2 ; cartname [32] 30 | .\_1 31 | ds 32-(.\_1-.\_0) 32 | .\_2 33 | dc.b \3 ; manufacturer[16] 34 | .\_3 35 | ds 16-(.\_3-.\_2) 36 | dc.b \4 ; rotation 37 | dc.b 0 ; AUDIN 38 | dc.b \5 ; eeprom 39 | dc.b 0,0,0 40 | ENDM 41 | -------------------------------------------------------------------------------- /macros/newop.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | MACRO initIdTab 3 | ldx #0 4 | .\l1 txa 5 | sta idtab,x 6 | inx 7 | bne .\l1 8 | ENDM 9 | 10 | MACRO tyx 11 | ldx idtab,y 12 | ENDM 13 | 14 | MACRO txy 15 | ldy idtab,x 16 | ENDM 17 | 18 | MACRO andx 19 | and idtab,x 20 | ENDM 21 | 22 | MACRO andy 23 | and idtab,y 24 | ENDM 25 | 26 | MACRO orax 27 | ora idtab,x 28 | ENDM 29 | 30 | MACRO oray 31 | ora idtab,y 32 | ENDM 33 | 34 | MACRO eorx 35 | eor idtab,x 36 | ENDM 37 | 38 | MACRO eory 39 | eor idtab,y 40 | ENDM 41 | 42 | MACRO adcx 43 | adc idtab,x 44 | ENDM 45 | 46 | MACRO adcy 47 | adc idtab,y 48 | ENDM 49 | 50 | MACRO sbcx 51 | sbc idtab,x 52 | ENDM 53 | 54 | MACRO sbcy 55 | sbc idtab,y 56 | ENDM 57 | 58 | MACRO cmpx 59 | cmp idtab,x 60 | ENDM 61 | 62 | MACRO cmpy 63 | cmp idtab,y 64 | ENDM 65 | 66 | MACRO bitx 67 | bit idtab,x 68 | ENDM 69 | -------------------------------------------------------------------------------- /font/font.doc: -------------------------------------------------------------------------------- 1 | * FONT.DOC 2 | * (C) Bastian Schick 3 | 4 | 1. All these fonts are proportional ! 5 | 2. Only characters needed are in a font ! 6 | 3. All fonts are mono-chrome ! 7 | 8 | struct FontHeader { 9 | BYTE fntLineOffset; /* points to the next data line */ 10 | BYTE fntHeight; /* ?? */ 11 | BYTE fntFirst,fntLast; /* first/last char. in the font */ 12 | BYTE fntBitLen[ ... ] /* width of each char in bit */ 13 | BYTE fntCharOffset[ ... ] /* byte position of each char */ 14 | BYTE fntBitOffset[ ... ] /* bit positon in the first byte */ 15 | BYTE fntData[fntLineOffset][fntHeight] 16 | } 17 | 18 | example : Font with '!','"' and '#' 19 | 20 | dc.b 3 21 | dc.b 8 22 | dc.b "!","#" 23 | dc.b 4,5,8 24 | dc.b 0,0,1 25 | dc.b 7,3,6 26 | dc.b 23,40,128 27 | . 28 | . 29 | dc.b 0,45,128 30 | 31 | => "!" is in the first byte (char-off = 0) in the MSB (7.) to the 4th bit. 32 | "#" is in the second byte (char-off = 1) in bit 6 to the MSB of byte 3. 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /font/font.txt: -------------------------------------------------------------------------------- 1 | * FONT.DOC 2 | * (C) Bastian Schick 3 | 4 | 1. All these fonts are proportional ! 5 | 2. Only characters needed are in a font ! 6 | 3. All fonts are mono-chrome ! 7 | 8 | struct FontHeader { 9 | BYTE fntLineOffset; /* points to the next data line */ 10 | BYTE fntHeight; /* ?? */ 11 | BYTE fntFirst,fntLast; /* first/last char. in the font */ 12 | BYTE fntBitLen[ ... ] /* width of each char in bit */ 13 | BYTE fntCharOffset[ ... ] /* byte position of each char */ 14 | BYTE fntBitOffset[ ... ] /* bit positon in the first byte */ 15 | BYTE fntData[fntLineOffset][fntHeight] 16 | } 17 | 18 | example : Font with '!','"' and '#' 19 | 20 | dc.b 3 21 | dc.b 8 22 | dc.b "!","#" 23 | dc.b 4,5,8 24 | dc.b 0,0,1 25 | dc.b 7,3,6 26 | dc.b 23,40,128 27 | . 28 | . 29 | dc.b 0,45,128 30 | 31 | => "!" is in the first byte (char-off = 0) in the MSB (7.) to the 4th bit. 32 | "#" is in the second byte (char-off = 1) in bit 6 to the MSB of byte 3. 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /uloader/readme.md: -------------------------------------------------------------------------------- 1 | # Micro Loader 2 | 3 | This is a minimal loader for card files. 4 | 5 | * ml.enc 6 | 7 | Encrypted header for 256K carts. Must be concatenated with the binary of the game. 8 | First byte of the game must contain the number of pages. Game goes to $200. 9 | 10 | * ml512.enc 11 | 12 | Encrypted header for 512K carts. Must be concatenated with the binary of the game. 13 | First byte of the game must contain the number of pages. Game goes to $200. 14 | 15 | * bll.enc 16 | 17 | Encrypted header for files with BLL header. Concatenate with a BLL file to build a ROM image. 18 | 19 | * micro_loader.s 20 | 21 | Source of the loader. 22 | 23 | * bll_loader.s 24 | 25 | Source of the loader. 26 | 27 | * allff.lyx.bz2 28 | 29 | A binary with 256K $FF to fill the ROM file (better for flashing). 30 | 31 | * demo.s 32 | 33 | A small demo doing nothing but showing the use of the CART_HEADER macro to build a ready to run LNX file from single source. -------------------------------------------------------------------------------- /demos/depacker/krilldecr.var: -------------------------------------------------------------------------------- 1 | ; ------------------------------------------------------------------- 2 | ; begin of exo decruncher 3 | ; ------------------------------------------------------------------- 4 | 5 | BEGIN_ZP 6 | zp_len_lo ds 1 ; TODO unclear if more bytes?? 7 | 8 | zp_src_lo ds 1 9 | zp_src_hi ds 1 10 | 11 | zp_bits_hi ds 1 12 | 13 | zp_bitbuf ds 3 14 | zp_dest_lo ds 1 ; dest addr lo 15 | zp_dest_hi ds 1 ; dest addr hi 16 | 17 | END_ZP 18 | 19 | BEGIN_MEM 20 | ; ------------------------------------------------------------------- 21 | ; this 156 byte table area may be relocated. It may also be clobbered 22 | ; by other data between decrunches. 23 | ; ------------------------------------------------------------------- 24 | decrunch_table ds 156 25 | END_MEM 26 | 27 | ; ------------------------------------------------------------------- 28 | ; end of decruncher 29 | ; ------------------------------------------------------------------- 30 | -------------------------------------------------------------------------------- /demos/Rules.launch: -------------------------------------------------------------------------------- 1 | # -*-makefile-*- 2 | ifneq ($(findstring darwin,$(OSTYPE)),) 3 | #SENDOBJ=$(BLL_ROOT)/sendobj.js/sendobj.js 4 | SENDOBJ=python3 $(BLL_ROOT)/sendobj.py/sendobj.py -q 5 | FLASHER=python3 $(BLL_ROOT)/flash_up.py/flash_up.py -q 6 | COM?=/dev/tty.usbserial-FT63V37G 7 | else 8 | SENDOBJ=sendobj.exe 9 | FLASHER=flash_up.exe 10 | COM?=COM7 11 | endif 12 | 13 | MACOS=@prlexec --vm "Windows 11" -r 14 | ifeq ($(findstring aarch64,$(MACHTYPE)),aarch64) 15 | FELIX=$(MACOS) /fun/Felix.exe 16 | else 17 | FELIX=/fun/lynx/Felix.exe 18 | endif 19 | 20 | BAUD?=1000000 21 | 22 | 23 | .PHONY: send 24 | send: $(DEMO).o 25 | @$(SENDOBJ) -b $(BAUD) -p $(COM) $< 26 | 27 | .PHONY: erase 28 | erase: 29 | @$(FLASHER) -b $(BAUD) -p $(COM) -e 30 | 31 | .PHONY: flash 32 | flash: lnx 33 | @$(FLASHER) -b $(BAUD) -p $(COM) -e -f $(DEMO).lnx 34 | 35 | .PHONY: sram 36 | sram: lnx 37 | @sram_up.exe -b $(BAUD) -p $(COM) -w $(DEMO).lnx 38 | 39 | felix: $(DEMO).o 40 | $(FELIX) $< 41 | 42 | felix_lnx felix_rom: $(DEMO).lnx 43 | $(FELIX) $< 44 | -------------------------------------------------------------------------------- /uloader/demo.s: -------------------------------------------------------------------------------- 1 | ;;; Demo for CART_HEADER 2 | ;;; 3 | 4 | BlockSize equ 1024 5 | 6 | include 7 | include 8 | 9 | IFD LNX 10 | CART_HEADER "RAYCAST","42Bastian",0,0 11 | ELSE 12 | run $200 13 | ENDIF 14 | 15 | Start:: 16 | ; code will be loaded at $200! 17 | jsr subroutine 18 | sta 0 19 | endless: 20 | jmp endless 21 | REPT 19 22 | dc.b "Hjfvhfdsjhgjkfdhjkghfdkjghfdj sdafjdshgjkfhjkhghfjs" 23 | dc.b "000000000001111111111111111222222222222222222222222" 24 | dc.b "Hjfvhfdsjhgjkfdhjkghfdkjghfdj sdafjdshgjkfhjkhghfjs" 25 | dc.b "000000000001111111111111111222222222222222222222222" 26 | dc.b "Hjfvhfdsjhgjkfdhjkghfdkjghfdj sdafjdshgjkfhjkhghfjs" 27 | dc.b "000000000001111111111111111222222222222222222222222" 28 | dc.b "Hjfvhfdsjhgjkfdhjkghfdkjghfdj sdafjdshgjkfhjkhghfjs" 29 | dc.b "000000000001111111111111111222222222222222222222222" 30 | ENDR 31 | subroutine: 32 | rts 33 | End: 34 | 35 | size EQU *-$200 ; Take encrypted loader into account! 36 | -------------------------------------------------------------------------------- /uBLL/Makefile: -------------------------------------------------------------------------------- 1 | ifneq ($(findstring darwin,$(OSTYPE)),) 2 | FLASHER=python3 $(BLL_ROOT)/flash_up.py/flash_up.py -q 3 | COM?=/dev/tty.usbserial-FT63V37G 4 | else 5 | SENDOBJ=sendobj 6 | COM?=COM7 7 | endif 8 | BAUD?=1000000 9 | 10 | all: new_bll.lnx 11 | 12 | new_bll.lyx: bll_1st_stage_enc.bin bll_2nd_stage.bin 13 | cat bll_1st_stage_enc.bin bll_2nd_stage.bin >$@ 14 | bzcat allff.lyx.bz2 >> $@ 15 | 16 | lnx: new_bll.lnx 17 | new_bll.lnx : new_bll.lyx 18 | make_lnx $< -b0 256K -o $@ 19 | 20 | bll_1st_stage_enc.bin: bll_1st_stage.bin 21 | lynxenc $< $@ 22 | 23 | bll_1st_stage.bin: bll_1st_stage.asm 24 | lyxass -d -D LNX=1 -o $@ $< 25 | 26 | bll_2nd_stage.bin: bll_2nd_stage.asm 27 | lyxass -d -D LNX=1 -o $@ $< 28 | 29 | .PHONY: clean 30 | clean: 31 | rm -f *.bin *.lyx 32 | 33 | .PHONY: erase 34 | erase: 35 | $(FLASHER) -p $(COM) -e 36 | 37 | .PHONY: flash 38 | flash: lnx 39 | $(FLASHER) -p $(COM) -f new_bll.lnx 40 | 41 | .PHONY: sram 42 | sram: lnx 43 | sram_up.exe -p $(COM) -w new_bll.lnx 44 | -------------------------------------------------------------------------------- /includes/polygon.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | **************** 3 | * wire-frame polygon 4 | 5 | Polygon:: sta .pcolor 6 | ldx faces,y 7 | MOVE {proj_x,x},x1 8 | MOVE {proj_y,x},y1 9 | MOVE x1,ax 10 | MOVE y1,ay ; save first point 11 | .loop iny 12 | ldx faces,y 13 | inx 14 | beq .exit 15 | MOVE {proj_x-1,x},x2 16 | MOVE {proj_y-1,x},y2 17 | MOVE x2,bx 18 | MOVE y2,by 19 | lda .pcolor 20 | phy 21 | jsr DrawLine 22 | ply 23 | MOVE bx,x1 24 | MOVE by,y1 25 | bra .loop 26 | .exit MOVE ax,x2 27 | MOVE ay,y2 28 | iny 29 | lda .pcolor 30 | phy 31 | jsr DrawLine 32 | ply 33 | rts 34 | .pcolor ds 1 35 | **************** 36 | -------------------------------------------------------------------------------- /demos/insert/INSERT.ASM: -------------------------------------------------------------------------------- 1 | ; title-sprite loaded by LYNXER?.TTP or NEWLYNX.TTP 2 | ; if called without *.MAK 3 | ; assmeble if : lyxass -d insert 4 | 5 | include 6 | include 7 | include 8 | 9 | 10 | RUN $2400 11 | 12 | ATARI EQU 1 ; show Fuji 13 | 14 | STANDARD_PAL 15 | 16 | IF ATARI=0 17 | SCB db $01,$90,$00 18 | dw 0,insert 19 | dw 31,29 20 | dw $400,$400 21 | db $0F 22 | insert db 5,%11101001,%01110111,%01100111,0 23 | db 4,%01001101,%01000100,%01010010 24 | db 4,%01001111,%01110110,%01100010 25 | db 4,%01001011,%00010100,%01010010 26 | db 4,%11101001,%01110111,%01010010 27 | db 2,0 28 | db 4,%00010010,%11101000,%10111000 29 | db 4,%00011010,%10101101,%10100000 30 | db 4,%00011110,%11101111,%10110000 31 | db 4,%00010110,%10101010,%10100000 32 | db 4,%00010010,%10101000,%10111000 33 | db 0 34 | 35 | ELSE 36 | 37 | SCB db $41,$10,$00 38 | dw 0,atari 39 | dw 39,8 40 | dw $100,$100 41 | db $0F,$A0 42 | atari ibytes "atari.o" 43 | 44 | ENDIF 45 | END 46 | 47 | 48 | -------------------------------------------------------------------------------- /demos/overlay/Rules.launch: -------------------------------------------------------------------------------- 1 | # -*-makefile-*- 2 | ifneq ($(findstring darwin,$(OSTYPE)),) 3 | #SENDOBJ=$(BLL_ROOT)/sendobj.js/sendobj.js 4 | SENDOBJ=python3 $(BLL_ROOT)/sendobj.py/sendobj.py -q 5 | FLASHER=python3 $(BLL_ROOT)/flash_up.py/flash_up.py -q 6 | COM?=/dev/tty.usbserial-FT63V37G 7 | else 8 | SENDOBJ=sendobj.exe 9 | FLASHER=flash_up.exe 10 | COM?=COM7 11 | endif 12 | 13 | MACOS=@prlexec --vm "Windows 11" -r 14 | ifeq ($(findstring aarch64,$(MACHTYPE)),aarch64) 15 | FELIX=$(MACOS) /fun/Felix.exe 16 | else 17 | FELIX=/fun/lynx/Felix.exe 18 | endif 19 | 20 | BAUD?=1000000 21 | 22 | .PHONY: send 23 | send: $(DEMO).o 24 | @$(SENDOBJ) -b $(BAUD) -p $(COM) $< 25 | 26 | .PHONY: erase 27 | erase: 28 | @$(FLASHER) -b $(BAUD) -p $(COM) -e 29 | 30 | .PHONY: flash 31 | flash: lnx 32 | @$(FLASHER) -b $(BAUD) -p $(COM) -e -f $(DEMO)$(DEMO_EXT).lnx 33 | 34 | .PHONY: sram 35 | sram: lnx 36 | @sram_up.exe -b $(BAUD) -p $(COM) -w $(DEMO)$(DEMO_EXT).lnx 37 | 38 | felix: $(DEMO).o 39 | $(FELIX) $< 40 | 41 | felix_lnx felix_rom: $(DEMO)$(DEMO_EXT).lnx 42 | $(FELIX) $< 43 | -------------------------------------------------------------------------------- /demos/brk.asm: -------------------------------------------------------------------------------- 1 | ***************** 2 | * BRK.ASM 3 | * short program, that installs the BRK-server 4 | * and then stops 5 | * 6 | * created : 15.08.96 by Bastian Schick 7 | * changed 8 | * 23.12.96 Baudrate is taken from the loader ! 9 | **************** 10 | 11 | BRKuser set 1 12 | Baudrate set 62500 13 | 14 | 15 | include 16 | include 17 | include 18 | 19 | include 20 | include 21 | 22 | BEGIN_ZP 23 | BRKvec ds 2 24 | END_ZP 25 | 26 | 27 | RUN $200 28 | Start 29 | START_UP ; disable all IRQs, init S,cli,cld ... 30 | lda #$c 31 | sta $fff9 32 | INITBRK 33 | MOVEI EnterBRK,$FFFE ; set IRQ-vector on BRK-routine 34 | 35 | lda #%00011101 ; even par/clear all errors 36 | sta $fd8c 37 | lda #%00011000 ; enable count,enable reload 38 | sta $fd11 39 | lda $fd10 40 | sta _brk_baud+1 ; patch BRK-server 41 | ; lda #125000/Baudrate-1 42 | sta $fd10 ; 31250Bd 43 | cli 44 | stz $fda0 45 | lda #$42 46 | ldx #42 47 | ldy #$24 48 | ; fall into brk 49 | .1 50 | BREAKPOINT 0 51 | bra .1 52 | 53 | include 54 | -------------------------------------------------------------------------------- /macros/debug.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | * DEBUG.MAC 3 | * created : ??.??.19?? 4 | * 5 | * 28.8.96 new MACRO : BREAKPOINT [x[,"remote-command"]] 6 | 7 | 8 | MACRO INITBRK 9 | 10 | IFD BRKuser 11 | jsr InitBRK 12 | ENDIF 13 | 14 | ENDM 15 | 16 | MACRO BREAKPOINT 17 | IFD BRKuser 18 | IFVAR \0 19 | IF \0 > $1f 20 | fail "BREAKPOINT: Number too big. Valid range #$00 to #$1f" 21 | ENDIF 22 | IFVAR \1 23 | brk #(\0)|$20 24 | .\_0 25 | dc.b .\_1-.\_0 26 | dc.b \1 27 | .\_1 28 | ELSE 29 | brk #\0 30 | ENDIF 31 | ELSE 32 | brk #$ff ; Profiling breakpoint 33 | ENDIF 34 | ENDIF 35 | ENDM 36 | 37 | MACRO DEBUG 38 | php 39 | pha 40 | IFVAR \0 41 | SWITCH \0 42 | case "X" 43 | txa 44 | case "Y" 45 | tya 46 | elses 47 | lda \0 48 | ENDS 49 | ENDIF 50 | ; jsr SndComLynxByte 51 | .\wait_ 52 | bit $fd8c 53 | bpl .\wait_ 54 | sta $fd8d 55 | pla 56 | plp 57 | ENDM 58 | 59 | MACRO DEBUG_WAIT 60 | php 61 | pha 62 | stz DebugFlag 63 | .\wait_deb 64 | lda DebugFlag 65 | beq .\wait_deb 66 | pla 67 | plp 68 | ENDM 69 | -------------------------------------------------------------------------------- /demos/lite/route.lst: -------------------------------------------------------------------------------- 1 | BOX 0,0,160,102 2 | vx=0 3 | vy=0 4 | px=0 5 | py=0 6 | ax=0 7 | ay=0 8 | x=8 9 | y=8 10 | d=0.1 11 | dv=0.01 12 | da=0.9 13 | c=0 14 | DIM lx(2000),ly(2000) 15 | lmx=MOUSEX 16 | lmy=MOUSEY 17 | REPEAT 18 | UNTIL MOUSEK=1 19 | x=MOUSEX 20 | nx=x 21 | y=MOUSEY 22 | ny=y 23 | REPEAT 24 | mx=MOUSEX 25 | my=MOUSEY 26 | px=d*(mx-x) 27 | py=d*(my-y) 28 | ax=(ax+px)*da 29 | ay=(ay+py)*da 30 | vx=(vx+ax)*dv 31 | vy=(vy+ay)*dv 32 | nx=nx+vx 33 | ny=ny+vy 34 | IF ABS(nx-x)>10 OR ABS(ny-y)>10 35 | PRINT AT(1,1);c 36 | PLOT x,y 37 | lx(c)=x DIV 4 38 | ly(c)=y DIV 4 39 | INC c 40 | x=nx 41 | y=ny 42 | ENDIF 43 | UNTIL MOUSEK=2 44 | OPEN "o",#1,"route.dat" 45 | PRINT #1,"route_x dc.b "; 46 | CLR l 47 | FOR i=0 TO c-1 48 | IF l<16 49 | PRINT #1,INT(lx(i));","; 50 | INC l 51 | ELSE 52 | PRINT #1 53 | PRINT #1,"dc.b "; 54 | CLR l 55 | ENDIF 56 | NEXT i 57 | PRINT #1,"route_y dc.b "; 58 | CLR l 59 | FOR i=0 TO c-1 60 | IF l<16 61 | PRINT #1,INT(ly(i));","; 62 | INC l 63 | ELSE 64 | PRINT #1 65 | PRINT #1,"dc.b "; 66 | CLR l 67 | ENDIF 68 | NEXT i 69 | CLOSE 70 | -------------------------------------------------------------------------------- /demos/lite/maske.sps: -------------------------------------------------------------------------------- 1 | 00000000000111111111100000000000 2 | 00000000111111111111111100000000 3 | 00000001111222222222211110000000 4 | 00000111122222222222222111100000 5 | 00001112222222222222222221110000 6 | 00011122222222222222222222111000 7 | 00011222222222222222222222211000 8 | 00112222222222222222222222221100 9 | 01112222222222222222222222221110 10 | 01122222222222222222222222222110 11 | 01122222222222222222222222222110 12 | 11222222222222222222222222222211 13 | 11222222222222222222222222222211 14 | 11222222222222222222222222222211 15 | 11222222222222222222222222222211 16 | 11222222222222222222222222222211 17 | 11222222222222222222222222222211 18 | 11222222222222222222222222222211 19 | 11222222222222222222222222222211 20 | 11222222222222222222222222222211 21 | 11222222222222222222222222222211 22 | 01122222222222222222222222222110 23 | 01122222222222222222222222222110 24 | 01112222222222222222222222221110 25 | 00112222222222222222222222221100 26 | 00011222222222222222222222211000 27 | 00011122222222222222222222111000 28 | 00001112222222222222222221110000 29 | 00000111122222222222222111100000 30 | 00000001111222222222211110000000 31 | 00000000111111111111111100000000 32 | 00000000000111111111100000000000 33 | 34 | -------------------------------------------------------------------------------- /vardefs/window.var: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ; variables for WINDOW 3 | 4 | STRUCT WCB 5 | IF SCR_MAX_X>255 6 | WCBX dw 0 7 | ELSE 8 | WCBX db 0 9 | ENDIF 10 | IF SCR_MAX_Y>255 11 | WCBY dw 0 12 | ELSE 13 | WCBY db 0 14 | ENDIF 15 | IF SCR_MAX_X>255 16 | WCBW dw 0 17 | ELSE 18 | WCBW db 0 ; width in pels 19 | ENDIF 20 | IF SCR_MAX_Y>255 21 | WCBH dw 0 22 | ELSE 23 | WCBH db 0 ; height in pels 24 | ENDIF 25 | WCBCol db 0 ; inner color 26 | WCBBorder db 0 ; frame-color 27 | WCBBorderW db 0 ; frame-width 28 | WCBDest dw 0 ; address for buffered-background 29 | ; 0 => no buffering 30 | ENDSTRUCT WCB 31 | ************* 32 | * Control-Block for lines,points and (filled) rectangles 33 | ************* 34 | STRUCT LCB ; LineControlBlock 35 | IF SCR_MAX_X>255 36 | LineX dw 0 37 | ELSE 38 | LineX db 0 39 | ENDIF 40 | IF SCR_MAX_Y>255 41 | LineY dw 0 42 | ELSE 43 | LineY db 0 44 | ENDIF 45 | IF SCR_MAX_X>255 46 | LineW dw 0 47 | ELSE 48 | LineW db 0 49 | ENDIF 50 | IF SCR_MAX_Y>255 51 | LineH dw 0 52 | ELSE 53 | LineH db 0 54 | ENDIF 55 | LineColor db 0 56 | LineWidth db 0 57 | ENDSTRUCT LCB 58 | 59 | BEGIN_ZP 60 | ptr dw 0 61 | ptr2 dw 0 62 | TempLCB ds LCB.LEN 63 | TempVal dw 0 64 | TempVal2 dw 0 65 | END_ZP 66 | -------------------------------------------------------------------------------- /uloader/Makefile: -------------------------------------------------------------------------------- 1 | all: ml512.enc ml.enc bll.enc bll512.enc demo0006.lnx demo0006_512.lnx\ 2 | demo.lnx 3 | 4 | micro_loader512.bin: micro_loader.S 5 | lyxass -d -D _512K -o $@ $< 6 | 7 | bll_loader512.bin: bll_loader.S 8 | lyxass -d -D _512K -o $@ $< 9 | 10 | %.bin: %.s 11 | lyxass -d -o $@ $< 12 | 13 | %.o: %.s 14 | lyxass -o $@ $< 15 | 16 | demo.lnx: demo.s ml.enc 17 | lyxass -d -D LNX=1 -o $@ $< 18 | 19 | ml.enc: micro_loader.bin 20 | lynxenc $< $@ 21 | 22 | ml512.enc: micro_loader512.bin 23 | lynxenc $< $@ 24 | 25 | bll.enc: ml.enc bll_loader.bin 26 | cat ml.enc bll_loader.bin >$@ 27 | 28 | bll512.enc: ml512.enc bll_loader512.bin 29 | cat ml512.enc bll_loader512.bin >$@ 30 | 31 | demo0006.lnx: bll.enc 32 | cat bll.enc ../demos/demo0006.o > demo0006.lyx 33 | bzcat allff.lyx.bz2 >> demo0006.lyx 34 | make_lnx demo0006.lyx -b0 256K -o $@ 35 | rm -f demo0006.lyx 36 | 37 | demo0006_512.lnx: bll512.enc 38 | cat bll512.enc ../demos/demo0006.o > demo0006.lyx 39 | bzcat allff.lyx.bz2 >> demo0006.lyx 40 | make_lnx demo0006.lyx -b0 512K -o $@ 41 | rm -f demo0006.lyx 42 | 43 | .PHONY: clean 44 | clean: 45 | rm -f *.bin 46 | rm -f demo.lnx ml.lyx demo0006.lnx demo0006_512.lnx 47 | -------------------------------------------------------------------------------- /vardefs/font2.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; Variables for FONT 3 | 4 | BEGIN_ZP 5 | TextPtr dw 0 6 | TextPtr2 dw 0 7 | TextPtr3 dw 0 8 | MaxTextLen dw 0 9 | CurrFntNr db 0 10 | CurrFnt dw 0 ; ptr to Font-data 11 | CurrLen dw 0 ; ptr to length-table 12 | CurrByteOff dw 0 ; ptr to Byte-Offset-Table 13 | CurrBitOff dw 0 ; ptr to Bit-Offset-Table 14 | CurrLineOff db 0 ; Line-Offset 15 | CurrHeight db 0 ; char height 16 | CurrFirst db 0 ; first char 17 | CurrLast db 0 ; last char 18 | CurrBiggest db 0 ; max. char-width 19 | CurrOffset db 0 ; Line-Offset 20 | CurrAjust db 0 21 | Invers db 0 22 | CurrSize db 0 23 | IF SCR_MAX_X>255 24 | CurrX dw 0 25 | ELSE 26 | CurrX db 0 27 | ENDIF 28 | IF SCR_MAX_Y>255 29 | CurrY dw 0 30 | ELSE 31 | CurrY db 0 32 | ENDIF 33 | IF SCR_MAX_X>255 34 | MinX dw 0 ; cursor limits 35 | MaxX dw 0 36 | ELSE 37 | MinX db 0 38 | MaxX db 0 39 | ENDIF 40 | IF SCR_MAX_Y>255 41 | MinY dw 0 42 | MaxY dw 0 43 | ELSE 44 | MinY db 0 45 | MaxY db 0 46 | ENDIF 47 | BG_Color db 0 48 | FG_Color db 0 49 | END_ZP 50 | 51 | ; these vars needn't to be in ZP 52 | 53 | BEGIN_ZP 54 | LocalFont equ * 55 | Ycount db 0 ; Line counter 56 | ByteCount db 0 ; byte per line 57 | _Bit db 0 ; which bit ? 58 | Byte db 0 59 | BitCount db 0 ; significant bits 60 | FontBitBuffer ds 3 61 | END_ZP 62 | -------------------------------------------------------------------------------- /includes/1000Hz.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | * 1000Hz-Timer 3 | * 4 | * 19.07.19 clean up 5 | * conditional use of RTC (define RTC before including) 6 | * 26.03.97 removed VBL-stuff 7 | * select Timer by main (set _1000HZ_TIMER) 8 | 9 | Init1000Hz:: 10 | php 11 | sei 12 | lda #249 13 | sta $fd00+_1000HZ_TIMER*4 14 | lda #%10011010 ; 250KHz 15 | sta $fd01+_1000HZ_TIMER*4 16 | IFD RTC 17 | lda #$ff-$e8 18 | sta milli 19 | lda #$ff-3 20 | sta milli+1 21 | stz seconds 22 | stz minutes 23 | ENDIF 24 | stz _1000Hz 25 | stz _1000Hz+1 26 | stz _1000Hz+2 27 | SETIRQVEC _1000HZ_TIMER,_1000HzIRQ 28 | plp 29 | rts 30 | ;*************** 31 | ;* Millisecond-Timer 32 | ;*************** 33 | _1000HzIRQ:: 34 | inc _1000Hz 35 | bne .cont 36 | inc _1000Hz+1 37 | bne .cont 38 | inc _1000Hz+2 39 | .cont 40 | IFD RTC 41 | inc milli 42 | bne .cont1 43 | inc milli+1 44 | bne .cont1 45 | 46 | lda #$ff-$e8 47 | sta milli 48 | lda #$ff-3 49 | sta milli+1 50 | 51 | sed 52 | clc 53 | lda seconds 54 | adc #1 55 | sta seconds 56 | cmp #$60 57 | bne .exit 58 | stz seconds 59 | lda minutes 60 | adc #1 61 | sta minutes 62 | .exit 63 | .cont1 64 | ENDIF 65 | IFD KeyCounter 66 | lda KeyCounter 67 | ora KeyCounter+1 68 | bne .cont2 69 | END_IRQ 70 | .cont2 71 | inc KeyCounter 72 | beq .cont3 73 | END_IRQ 74 | .cont3 75 | inc KeyCounter+1 76 | ENDIF 77 | END_IRQ 78 | 79 | END 80 | -------------------------------------------------------------------------------- /includes/check_ee.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | **************** 3 | * CHECK_EE.INC 4 | * routine to check if there's a EEPROM and working correct 5 | * 6 | * first version : 25.04.96 by Bastian Schick 7 | * 8 | * last modified : 9 | * 10 | **************** 11 | 12 | okEEPROM EQU $0 13 | noEEPROM EQU $1 14 | koEEPROM EQU $2 15 | 16 | 17 | **************** 18 | * IN : - 19 | * OUT: A = EEPROM's state 20 | * 21 | * detroys all registers 22 | * 23 | * to be called once in a games live ;) 24 | **************** 25 | CheckEEPROM:: 26 | ldx #127-2 27 | .1 lda $fd02 28 | sta EEPROMbuffer,x 29 | .2 dec 30 | bpl .2 31 | dex 32 | bpl .1 33 | lda #EEPROMbuffer 35 | jsr WriteSaveGame ; EEPROM = RND 36 | 37 | lda #EEPROMbuffer 39 | jsr LoadSaveGame ; check it 40 | tay ; Save Flag 41 | ldx #127-2 ; all cell execept Checksum 42 | lda #$ff 43 | .3 cmp EEPROMbuffer,x 44 | bne .90 45 | dex 46 | bpl .3 47 | lda #noEEPROM ; all cells = $FF ! 48 | rts 49 | 50 | .90 tya 51 | bne .ko 52 | ldx #127-2 53 | .91 stz EEPROMbuffer,x 54 | dex 55 | bpl .91 56 | lda #EEPROMbuffer 58 | jsr WriteSaveGame ; EEPROM = 0 59 | 60 | lda #EEPROMbuffer 62 | jsr LoadSaveGame ; check again 63 | beq .ok 64 | .ko lda #koEEPROM 65 | rts 66 | .ok lda #okEEPROM 67 | rts 68 | ***** 69 | *EOF* 70 | ***** 71 | -------------------------------------------------------------------------------- /vardefs/sound.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | **************** 3 | * Sound-variablen 4 | BEGIN_ZP 5 | t1 ds 1 6 | t2 ds 2 7 | 8 | SndSema ds 1 ; <>0 => Sound IRQ in progress 9 | SndPtrTmp ds 2 10 | SndTmp ds 2 11 | SndEnvPtr ds 2 12 | END_ZP 13 | 14 | BEGIN_MEM 15 | SndPtrLo ds 4 16 | SndPtrHi ds 4 17 | 18 | SndDelay ds 4 19 | SndLoopCnt ds 4 20 | SndLoopPtrLo ds 4 21 | SndLoopPtrHi ds 4 22 | SndVolume ds 4 23 | SndMaxVolume ds 4 24 | SndNotePlaying ds 4 25 | SndRetAddr ds 4*2 26 | 27 | SndActive ds 4 ; <>0 => channel active 28 | SndReqStop ds 4 29 | SndEnvVol ds 4 ; <>0 => use envelope x 30 | SndEnvFrq ds 4 ; dito 31 | ;>SndEnvPly ds 4 ; dito 32 | 33 | SndChannel ds 4*8 ; current values 34 | * volume env. 35 | SndEnvVolCnt ds 4 36 | SndEnvVolInc ds 4 37 | SndEnvVolOff ds 4 38 | SndEnvVolLoop ds 4 39 | SndEnvVolParts ds 4 40 | SndEnvVolParts2 ds 4 41 | 42 | 43 | * 44 | * frequenz env. 45 | SndEnvFrqCnt ds 4 46 | SndEnvFrqInc ds 4 47 | SndEnvFrqOff ds 4 48 | SndEnvFrqLoop ds 4 49 | SndEnvFrqParts ds 4 50 | SndEnvFrqParts2 ds 4 51 | 52 | * 53 | 54 | SndEnvVolPtrLo ds 16 55 | SndEnvVolPtrHi ds 16 56 | SndEnvFrqPtrLo ds 16 57 | SndEnvFrqPtrHi ds 16 58 | ;>SndEnvPlyPtrLo ds 16 59 | ;>SndEnvPlyPtrHi ds 16 60 | END_MEM 61 | 62 | **************** 63 | -------------------------------------------------------------------------------- /macros/irq.mac: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | MACRO INITIRQ 3 | irq_vecs equ \0 4 | jsr InitIRQ 5 | ENDM 6 | 7 | IFND NEW_IRQ_HANDLER 8 | MACRO IRQ 9 | irq:: cld 10 | phx 11 | pha 12 | IFD break_user 13 | tsx 14 | inx 15 | inx 16 | inx 17 | lda $100,x ; p-register 18 | bit #$10 ; break ?? 19 | beq .no_break 20 | and #$ef 21 | sta $100,x 22 | pla 23 | plx 24 | jmp (break_vec) 25 | ENDIF 26 | 27 | .no_break lda $fd81 28 | sta $fd80 29 | ldx #0 30 | .loop lsr 31 | bcc .cont 32 | sta irq_save_a 33 | stx irq_save_x 34 | jsr .do_irq 35 | ldx irq_save_x 36 | lda irq_save_a 37 | .cont beq end_irq 38 | inx 39 | inx 40 | bra .loop 41 | .do_irq jmp (irq_vecs,x) 42 | 43 | dummy_irq rts 44 | 45 | end_irq pla 46 | plx 47 | rti 48 | ENDM 49 | ENDIF 50 | 51 | MACRO END_IRQ 52 | pla 53 | IFND NEW_IRQ_HANDLER 54 | plx 55 | ENDIF 56 | rti 57 | ENDM 58 | 59 | MACRO SETIRQ 60 | php 61 | sei 62 | ifVAR \0 63 | IFVAR \1 64 | lda #<(\1) 65 | sta irq_vecs+(\0)*2 66 | lda #>(\1) 67 | sta irq_vecs+(\0)*2+1 68 | endif 69 | endif 70 | if \0<>4 71 | lda #$80 72 | tsb $fd01+(\0)*4 73 | endif 74 | plp 75 | ENDM 76 | 77 | MACRO SETIRQVEC 78 | ifVAR \0 79 | IFVAR \1 80 | lda #<(\1) 81 | sta irq_vecs+(\0)*2 82 | lda #>(\1) 83 | sta irq_vecs+(\0)*2+1 84 | endif 85 | endif 86 | ENDM 87 | 88 | MACRO RESIRQ 89 | php 90 | sei 91 | if \0<>4 92 | lda #$80 93 | trb $fd01+(\0)*4 94 | endif 95 | plp 96 | ENDM 97 | -------------------------------------------------------------------------------- /macros/sound.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | MACRO DELAY 3 | ps set \0 4 | REPT 10 5 | IF ps > 255 6 | dc.b $82,0 7 | ps set ps - 256 8 | ELSE 9 | IF ps > 0 10 | dc.b $82,ps 11 | ps set 0 12 | ENDIF 13 | ENDIF 14 | ENDR 15 | ENDM 16 | 17 | MACRO PLAY 18 | dc.b \0 19 | IF \1 > 255 20 | dc.b 0 21 | ps2 set \1-256 22 | DELAY ps2 23 | ELSE 24 | dc.b \1 25 | ENDIF 26 | ENDM 27 | 28 | MACRO PLAY2 29 | dc.b $85 30 | dc.b \0 ; reload 31 | dc.b \1 ; prescale 32 | IF \2 > 255 33 | dc.b 0 34 | ps2 set \2-256 35 | DELAY ps2 36 | ELSE 37 | dc.b \2 38 | ENDIF 39 | ENDM 40 | 41 | 42 | MACRO PATTERN 43 | dc.b $86 44 | dc.w \0 45 | ENDM 46 | 47 | MACRO DEFFRQ 48 | dc.b $8a,\0 49 | dc.w \1 50 | ENDM 51 | 52 | MACRO DEFVOL 53 | dc.b $88,\0 54 | dc.w \1 55 | ENDM 56 | 57 | MACRO SETFRQ 58 | dc.b $8b,\0 59 | ENDM 60 | 61 | MACRO SETVOL 62 | dc.b $89,\0 63 | ENDM 64 | 65 | MACRO INSTR 66 | dc.b $84,0,0,\0,\1,\2 67 | ENDM 68 | 69 | MACRO STOP 70 | dc.b $83 71 | ENDM 72 | 73 | MACRO DO 74 | dc.b $80,\0 75 | ENDM 76 | MACRO LOOP 77 | dc.b $81 78 | ENDM 79 | -------------------------------------------------------------------------------- /vardefs/font.var: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; Variables for FONT 3 | 4 | BEGIN_ZP 5 | TextPtr dw 0 6 | TextPtr2 dw 0 7 | TextPtr3 dw 0 8 | MaxTextLen dw 0 9 | CurrFntNr db 0 10 | CurrFnt dw 0 ; ptr to Font-data 11 | CurrLen dw 0 ; ptr to Length-table 12 | CurrByteOff dw 0 ; ptr to Byte-Offset-Table 13 | CurrBitOff dw 0 ; ptr to Bit-Offset-Table 14 | CurrLineOff db 0 ; line-Offset 15 | CurrHeight db 0 ; char height 16 | CurrFirst db 0 ; first char 17 | CurrLast db 0 ; last char 18 | CurrBiggest db 0 ; max. char width 19 | CurrOffset db 0 ; line-offset 20 | CurrAdjust 21 | CurrAjust db 0 22 | Invers db 0 23 | CurrSize db 0 24 | CurrX db 0 25 | IF SCR_MAX_X>255 26 | db 0 27 | ENDIF 28 | CurrY db 0 29 | IF SCR_MAX_Y>255 30 | db 0 31 | ENDIF 32 | IF SCR_MAX_X>255 33 | MinX dw 0 ; cursor-limits 34 | MaxX dw 0 35 | ELSE 36 | MinX db 0 37 | MaxX db 0 38 | ENDIF 39 | IF SCR_MAX_Y>255 40 | MinY dw 0 41 | MaxY dw 0 42 | ELSE 43 | MinY db 0 44 | MaxY db 0 45 | ENDIF 46 | BG_Color db 0 47 | FG_Color db 0 48 | END_ZP 49 | 50 | ; vars may lay anywhere YOU want 51 | 52 | BEGIN_ZP 53 | LineCounter ds 1 54 | ByteCounter ds 1 55 | BitCounter ds 1 56 | BitCounter2 ds 1 57 | BitBuff ds 10 58 | Laenge ds 2 59 | END_ZP 60 | -------------------------------------------------------------------------------- /demos/depacker/unlz4.asm: -------------------------------------------------------------------------------- 1 | ;;; in: 2 | ;;; ZP 3 | ;;; src 4 | ;;; dst 5 | ;;; A:Y packed length 6 | 7 | unlz4:: 8 | .token 9 | jsr lz4_getbyte 10 | sta .smc+1 11 | lsr 12 | lsr 13 | lsr 14 | lsr 15 | beq .match 16 | jsr lz4_getlen 17 | .litloop 18 | jsr lz4_getbyte 19 | jsr lz4_storebyte 20 | bne .litloop 21 | 22 | .match 23 | jsr lz4_getbyte 24 | tay 25 | clc 26 | sbc dst 27 | eor #$ff 28 | sta lz4_ptr 29 | 30 | jsr lz4_getbyte 31 | tax 32 | sbc dst+1 33 | eor #$ff 34 | sta lz4_ptr+1 35 | 36 | tya 37 | bne .smc 38 | txa 39 | beq ._rts 40 | .smc 41 | lda #10 42 | and #15 43 | jsr lz4_getlen 44 | sec 45 | txa 46 | sbc #4 47 | tax 48 | bcs .matchloop 49 | dey 50 | .matchloop 51 | lda (lz4_ptr) 52 | inc lz4_ptr 53 | bne .2 54 | inc lz4_ptr+1 55 | .2 56 | jsr lz4_storebyte 57 | bne .matchloop 58 | bra .token 59 | 60 | lz4_getlen 61 | ldy #$ff 62 | cmp #15 63 | bne .noext 64 | .loop 65 | sta lz4_tmp 66 | jsr lz4_getbyte 67 | tax 68 | clc 69 | adc lz4_tmp 70 | bcc .3 71 | dey 72 | .3 73 | inx 74 | beq .loop 75 | .noext 76 | eor #$ff 77 | tax 78 | inx 79 | bne ._rts 80 | iny 81 | ._rts 82 | rts 83 | 84 | lz4_getbyte:: 85 | lda (src) 86 | inc src 87 | bne .9 88 | inc src+1 89 | .9 rts 90 | 91 | lz4_storebyte:: 92 | sta (dst) 93 | inc dst 94 | bne .9 95 | inc dst+1 96 | .9 inx 97 | bne .99 98 | iny 99 | .99 100 | rts 101 | 102 | echo "%hunlz4 %hlz4_getlen" 103 | -------------------------------------------------------------------------------- /macros/file.mac: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ; MACROS and constants for FILE 3 | ; 4 | IFND BlockSize 5 | BlockSize set 1024 6 | ENDIF 7 | 8 | STRUCT DirEntry 9 | StartBlock db 0 10 | BlockOffset dw 0 11 | ExecFlag db 0 12 | DestAddr dw 0 13 | FileLen dw 0 14 | ENDSTRUCT DirEntry 15 | 16 | MACRO LOADDIR 17 | IFVAR \0 18 | lda \0 19 | ENDIF 20 | jsr LoadDir 21 | ENDM 22 | 23 | MACRO LOADFILE 24 | LoadFileUser SET 1 25 | IFVAR \1 26 | IFVAR \0 27 | lda #<(\1) 28 | sta DestPtr 29 | lda #>(\1) 30 | sta DestPtr+1 31 | lda \0 32 | ELSE 33 | pha 34 | lda #<(\1) 35 | sta DestPtr 36 | lda #>(\1) 37 | sta DestPtr+1 38 | pla 39 | ENDIF ; IFVAR \0 40 | ELSE 41 | IFVAR \0 42 | lda \0 43 | ENDIF 44 | ENDIF 45 | jsr LoadFile 46 | ENDM 47 | 48 | MACRO LOADPRG 49 | LoadPrgUser SET 1 50 | IFVAR \0 51 | lda \0 52 | ENDIF 53 | IFVAR \1 54 | ldy #$FF 55 | ELSE 56 | ldy #0 57 | ENDIF 58 | jsr LoadPrg 59 | ENDM 60 | -------------------------------------------------------------------------------- /uloader/micro_loader.s: -------------------------------------------------------------------------------- 1 | ; micro loader 2 | ; 3 | ; programm must start at $1ff, first byte must contain number of 4 | ; pages to load (see demo.s), so actual code at $200 5 | ; 6 | ; Note: Does not clear AUDIN, therefore not for use for bank-switching carts! 7 | ; (lda #$1a; sta $FD8A, and FE00 sets AUDIN (B4) == 0) 8 | ; 9 | ; Currently 3 bytes spare ... 10 | 11 | ; Addresses 12 | RCART_0 EQU $fcb2 ; cart data register 13 | BLOCKNR EQU 0 ; zeroed by ROM 14 | PAGECNT EQU $1ff 15 | 16 | RUN $0200 17 | 18 | ; Copy loader onto stack 19 | txs ; x = 0 after ROM 20 | ldx #(b9+1)-b0 21 | cpy: 22 | stz $fda0,x ; clear colors 23 | lda b0,x ; copy loader 24 | pha 25 | dex 26 | bpl cpy 27 | 28 | ldy #51+1 ; already 51 bytes loaded from 1st block! 29 | bra $200-(b9+1-b1) ; bra b1 30 | 31 | ; From here copied onto stack 32 | b0: 33 | dex 34 | bne b2 35 | inc BLOCKNR ; next block 36 | lda BLOCKNR 37 | jsr $fe00 ; select block 38 | b1: 39 | IFD _512K 40 | ldx #8 41 | ELSE 42 | ldx #4 ; 4 pages per block 43 | ENDIF 44 | b2: 45 | lda RCART_0 46 | DST 47 | sta $200-(51+2),y ; first byte goes to $1ff (PAGECNT) 48 | iny 49 | bne b2 50 | 51 | inc $200-(b9+1-DST)+2 ; next dst page 52 | 53 | dec PAGECNT 54 | bne b0 55 | dc.b $a2 ; opcode "LDX" 56 | ; PAGECNT will be here, zero after loading => LDX #0 57 | b9: 58 | ; program is here at $200! 59 | 60 | endofbl: 61 | 62 | size set endofbl-$200 63 | free set 49-size 64 | 65 | echo "Free %Dfree" 66 | IF free < 0 67 | echo "Size must be <= 50!" 68 | ENDIF 69 | 70 | ; fill remaining space 71 | IF free > 0 72 | REPT free 73 | dc.b $42 ; unused space shall not be 0! 74 | ENDR 75 | ENDIF 76 | dc.b $00 ; end mark! 77 | -------------------------------------------------------------------------------- /includes/savegame.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | *********** 3 | * SAVEGAME 4 | * created : 11.5.95 5 | * (c) 1995 Bastian Schick 6 | * 7 | * WriteSaveGame - writes EEPROM 8 | * LoadSaveGame - reads total EEPROM to memory 9 | * 10 | * last modified : 11 | * 12 | * 18.03.96 removed self-modifying code (make's hacking , sorry debuging 13 | * easier ;)) (Hi Harry ) 14 | 15 | 16 | 17 | **************** 18 | * IN : Y:A address of 128byte default 19 | * byte 126/127 are used for checksum 20 | **************** 21 | WriteSaveGame:: 22 | stz temp 23 | stz temp+1 24 | sta temp1 25 | sty temp1+1 26 | 27 | ldy #0 28 | ldx #0 29 | .loop phx 30 | clc 31 | lda (temp1),y 32 | sta I2Cword 33 | adc temp 34 | sta temp 35 | iny 36 | lda (temp1),y 37 | sta I2Cword+1 38 | adc temp+1 39 | sta temp+1 40 | iny 41 | txa 42 | phy 43 | jsr EE_Write 44 | ply 45 | plx 46 | inx 47 | cpx #$3f 48 | bne .loop 49 | MOVE temp,I2Cword 50 | txa 51 | jmp EE_Write 52 | **************** 53 | * IN : Y:A adress of 128 free space 54 | * OUT : X:Y = checksum 55 | * A = 0 => OK 56 | * A # 0 => checksum error 57 | **************** 58 | LoadSaveGame:: sta temp1 59 | sty temp1+1 60 | 61 | stz temp 62 | stz temp+1 63 | ldy #0 64 | ldx #0 65 | .loop phx 66 | phy 67 | 68 | txa 69 | jsr EE_Read ; Read from address X 70 | ply 71 | clc 72 | lda I2Cword 73 | sta (temp1),y 74 | adc temp 75 | sta temp 76 | iny 77 | lda I2Cword+1 78 | sta (temp1),y 79 | adc temp+1 80 | sta temp+1 81 | iny 82 | plx 83 | inx 84 | cpx #$3f 85 | bne .loop 86 | txa 87 | jsr EE_Read 88 | lda temp 89 | tax 90 | eor I2Cword 91 | sta temp 92 | lda temp+1 93 | tay 94 | eor I2Cword+1 95 | ora temp 96 | beq .exit 97 | lda #$ff 98 | .exit rts 99 | -------------------------------------------------------------------------------- /uloader/bll_loader.s: -------------------------------------------------------------------------------- 1 | ; BLL file loader 2 | ; 3 | ; This is a second stage loader for files with BLL header. 4 | ; It must be combined with ml.enc and the resulting file then with 5 | ; a BLL file. 6 | 7 | ; Addresses 8 | RCART_0 EQU $fcb2 ; cart data register 9 | BLOCKNR EQU 0 ; zeroed by ROM 10 | 11 | LENGTH EQU $f0 12 | DEST EQU $f2 13 | RUN_ADDR EQU $f4 14 | 15 | RUN $01ff 16 | 17 | dc.b 1 ; page count for uLoader 18 | 19 | lda HEADER_ORG+4 20 | eor #$ff 21 | sta LENGTH+1 22 | lda HEADER_ORG+5 23 | eor #$ff 24 | sta LENGTH 25 | lda HEADER_ORG+2 26 | sta DEST+1 27 | sta RUN_ADDR+1 28 | lda HEADER_ORG+3 29 | sta DEST 30 | sta RUN_ADDR 31 | ldx #$c0 ; stack below loader code 32 | txs 33 | ldy #b9-b0-1+2+1 34 | copy_loader: 35 | lda b0-1,y 36 | sta $1C0,y 37 | dey 38 | bne copy_loader 39 | IFD _512K 40 | ldx #7 ; already 1 page loaded from 1st block! 41 | ELSE 42 | ldx #3 ; already 1 page loaded from 1st block! 43 | ENDIF 44 | bra $1C0+(b2-b0+1) ; bra b2 45 | 46 | ; From here copied onto stack 47 | b0: 48 | dex 49 | bne b2 50 | inc BLOCKNR ; next block 51 | lda BLOCKNR 52 | jsr $fe00 ; select block 53 | b1: 54 | IFD _512K 55 | ldx #8 ; 8 pages per block 56 | ELSE 57 | ldx #4 ; 4 pages per block 58 | ENDIF 59 | b2: 60 | lda RCART_0 61 | sta (DEST) 62 | inc DEST 63 | bne b3 64 | inc DEST+1 65 | b3 66 | inc LENGTH 67 | bne b4 68 | inc LENGTH+1 69 | bne b4 70 | jmp (RUN_ADDR) 71 | b4 72 | iny 73 | bne b2 74 | bra b0 75 | 76 | b9: 77 | 78 | size set b9-$1ff 79 | ;; skip but leave space for BLL header 80 | ds 256-size-10-52 81 | 82 | HEADER_ORG: 83 | echo "Size %Dsize" 84 | -------------------------------------------------------------------------------- /sendobj.py/sendobj.py: -------------------------------------------------------------------------------- 1 | # 2 | # Send BLL .o file to the Lynx 3 | # 4 | import serial 5 | import sys 6 | from os.path import exists 7 | 8 | verbose=1 9 | baud=1000000 10 | port='/dev/cu.usbserial-FT63V37G' 11 | 12 | n = len(sys.argv) 13 | 14 | if n == 1: 15 | print("sendobj [-q] [-p ] [-b baud] file") 16 | print("Default: ",baud,"Bd Port:",port) 17 | exit(1) 18 | 19 | p=1 20 | while p < n-1: 21 | if sys.argv[p] == '-b': 22 | baud = sys.argv[p+1] 23 | p += 2 24 | 25 | if sys.argv[p] == '-p': 26 | port = sys.argv[p+1] 27 | p += 2 28 | 29 | if sys.argv[p] == '-q': 30 | verbose=0 31 | p += 1 32 | 33 | if p == n: 34 | print("Missing .o file") 35 | exit(1) 36 | 37 | filename=sys.argv[n-1] 38 | 39 | if exists(port) == False: 40 | print("Error: cannot find:",port) 41 | exit(1) 42 | 43 | if exists(filename) == False: 44 | print("Error: No such file:",filename) 45 | exit(1) 46 | 47 | image=bytearray() 48 | imhd=bytearray(10) 49 | header=bytearray(6) 50 | 51 | fd = open(filename,"rb") 52 | imhd = fd.read(10) 53 | image = fd.read() 54 | fd.close() 55 | size = len(image) 56 | if verbose == 1: 57 | print("Port:", port,"\nBaud:",baud) 58 | print("File:",filename,"(",size,")"); 59 | 60 | # Prepare transmit header 61 | header[0] = 0x81 62 | header[1] = 0x50 63 | header[2] = imhd[2] 64 | header[3] = imhd[3] 65 | header[4] = (size >> 8) ^ 0xff; 66 | header[5] = (size & 0xff) ^ 0xff; 67 | 68 | ser = serial.Serial(port,baud,parity='E',timeout=2.) 69 | 70 | ser.write(header) 71 | header=ser.read(6); # read back to slow down 72 | ser.write(image) 73 | image=ser.read(size) # read back to prevent early close of device 74 | ser.close() 75 | -------------------------------------------------------------------------------- /includes/depack.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | * depacker for TP packed files 3 | * (c) 1994 Bastian Schick 4 | * Last change : 25.4.94 5 | * Size : 119 Bytes 6 | * 7 | * Variablen (in ZP) 8 | IF 0 9 | org $0 10 | byte ds 1 11 | count ds 1 12 | HelpPtr ds 2 13 | laenge ds 2 14 | offset ds 2 15 | run $1000 16 | ENDIF 17 | 18 | *************** 19 | * read TP packed file 20 | * Size of the unpacked file is store in 21 | *************** 22 | ReadPackedBytes:: 23 | jsr ReadByte ; get 1st Byte 24 | tax 25 | bne .packed ; <>0 => file packed 26 | ldx laenge ; else get size into Y:X 27 | ldy laenge+1 28 | jmp ReadBytes ; and read all 29 | 30 | .packed stz count ; clear bit counter 31 | .loop0 asl count ; get next bit 32 | bne .loop1 ; not last bit => 33 | jsr ReadByte ; get next byte 34 | sta byte ; and save 35 | dec count ; re-init bit counter 36 | .loop1 asl byte ; PackByte << 37 | bcs .cont0 ; C=1 => match 38 | ;--------------- 39 | jsr ReadByte ; get literal byte 40 | sta (DestPtr) 41 | inc DestPtr 42 | bne .cont3 43 | inc DestPtr+1 44 | .cont3 inc laenge 45 | bne .loop0 46 | inc laenge+1 47 | bne .loop0 48 | rts 49 | ;--------------- 50 | .cont0 jsr ReadByte ; counter and offset 51 | tay ; save 52 | REPT 4 53 | lsr 54 | ENDR 55 | tax ; save 56 | jsr ReadByte ; offset low-Byte 57 | clc 58 | sbc DestPtr 59 | eor #$ff 60 | sta TempPtr 61 | txa 62 | sbc DestPtr+1 63 | eor #$ff 64 | sta TempPtr+1 65 | tya 66 | ldy #0 67 | and #$f 68 | inc 69 | inc 70 | tax 71 | .loop2 lda (TempPtr),y 72 | sta (DestPtr) 73 | inc DestPtr 74 | bne .cont 75 | inc DestPtr+1 76 | .cont inc laenge 77 | bne .cont2 78 | inc laenge+1 79 | beq .ende 80 | .cont2 iny 81 | dex 82 | bpl .loop2 83 | bra .loop0 84 | .ende rts 85 | -------------------------------------------------------------------------------- /demos/depacker/untp.asm: -------------------------------------------------------------------------------- 1 | ;;; in: 2 | ;;; ZP 3 | ;;; src 4 | ;;; dst 5 | ;;; Y:A - size of packed data 6 | 7 | CPY8 EQU 0 8 | 9 | untp:: 10 | eor #$ff 11 | sta tp_end 12 | tya 13 | eor #$ff 14 | sta tp_end+1 15 | stz tp_token 16 | .loop0 17 | asl tp_token 18 | bne .loop1 ; not last bit => 19 | .token 20 | jsr tp_getbyte ; get next byte 21 | sec 22 | rol 23 | sta tp_token ; and save 24 | .loop1 25 | jsr tp_getbyte ; literal byte or (count and offset) 26 | bcs .cont0 ; C=1 => match 27 | ;-- literal 28 | sta (dst) 29 | inc dst 30 | bne .loop0 31 | .incdst 32 | inc dst+1 33 | bra .loop0 34 | ;-- match 35 | .cont0 36 | tay ; save count 37 | lsr 38 | lsr 39 | lsr 40 | lsr 41 | tax ; save offset high byte 42 | jsr tp_getbyte ; offset low-Byte 43 | clc ; ptr = (offset ^ $ffff) - dst + 1 44 | sbc dst 45 | eor #$ff 46 | sta .loop2+1 47 | txa 48 | sbc dst+1 49 | eor #$ff 50 | sta .loop2+2 51 | tya 52 | ldy #0 53 | and #$f 54 | inc 55 | inc 56 | tax 57 | .loop2 lda $1234,y 58 | sta (dst),y 59 | iny 60 | dex 61 | bpl .loop2 62 | clc 63 | tya 64 | adc dst 65 | sta dst 66 | bcc .loop0 67 | bra .incdst 68 | 69 | 70 | IF 1=1 71 | tp_getbyte 72 | lda (src) 73 | inc src 74 | bne .9 75 | inc src+1 76 | .9 77 | inc tp_end 78 | bne .91 79 | inc tp_end+1 80 | bne .91 81 | pla 82 | pla 83 | .91 rts 84 | ELSE 85 | tp_getbyte 86 | lda (src) 87 | inc src 88 | beq .9 89 | inc tp_end 90 | beq .91 91 | rts 92 | 93 | .9 inc src+1 94 | inc tp_end 95 | beq .91 96 | rts 97 | .91 98 | inc tp_end+1 99 | beq .99 100 | rts 101 | .99 102 | pla 103 | pla 104 | rts 105 | ENDIF 106 | -------------------------------------------------------------------------------- /macros/microfnt.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ; 3 | ; MACROs for microfnt and microfn1 4 | ; 5 | 6 | macro INIT_MICROFNT 7 | 8 | ifnd mfnt 9 | 10 | include 11 | jmp .\_0 12 | mfnt ibytes 13 | 14 | .\_0 clc 15 | lda mfnt+3 16 | adc #32 17 | sta temp 18 | lda mfnt+2 19 | adc #0 20 | sta temp+1 21 | 22 | lda #<(mfnt+10+32) 23 | sta temp1 24 | lda #>(mfnt+10+32) 25 | sta temp1+1 26 | 27 | sec 28 | lda mfnt+5 29 | sbc #32 30 | sta mfnt+5 31 | lda mfnt+4 32 | sbc #0 33 | tax 34 | 35 | ldy #0 36 | .\_1 lda (temp1),y 37 | sta (temp),y 38 | iny 39 | bne .\_1 40 | inc temp+1 41 | inc temp1+1 42 | dex 43 | bne .\_1 44 | .\_2 lda (temp1),y 45 | sta (temp),y 46 | iny 47 | cpy mfnt+5 48 | bne .\_2 49 | 50 | ldx #7 51 | .\_3 lda mfnt+10,x 52 | sta $fda0,x 53 | lda mfnt+10+16,x 54 | sta $fdb0,x 55 | dex 56 | bpl .\_3 57 | 58 | endif 59 | endm 60 | 61 | 62 | macro MFNT_PRINTSTRINGXY 63 | ldx \0 64 | ldy \1 65 | lda #>\2 66 | pha 67 | lda #<\2 68 | jsr MFNT_PrintStringXY 69 | ENDM 70 | -------------------------------------------------------------------------------- /macros/fade.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | FADERATE SET 40 3 | 4 | MACRO FADE_OUT 5 | lda #$f 6 | sta .\mcount+1 7 | bra .\mloop1 8 | .\mcount ds 2 9 | 10 | .\mloop1 ldx #$f 11 | .\mloop2 lda $fda0,x 12 | beq .\mcont01 13 | dec $fda0,x 14 | bmi .\mcont2 15 | .\mcont01 lda $fdb0,x 16 | tay 17 | and #$f 18 | beq .\mcont02 19 | dec 20 | bmi .\mcont2 21 | .\mcont02 sta .\mcount 22 | tya 23 | and #$f0 24 | beq .\mcont03 25 | sec 26 | sbc #$10 27 | bcc .\mcont2 28 | .\mcont03 ora .\mcount 29 | sta $fdb0,x 30 | bra .\mcont3 31 | .\mcont2 stz $fda0,x 32 | stz $fdb0,x 33 | .\mcont3 dex 34 | bpl .\mloop2 35 | ldy #FADERATE 36 | .\mwait lda $fd0a 37 | bne .\mwait 38 | dey 39 | bne .\mwait 40 | dec .\mcount+1 41 | bne .\mloop1 42 | ENDM 43 | 44 | MACRO FADE_IN 45 | IFVAR \0 46 | lda #$f 47 | sta .\mcount+1 48 | bra .\mloop1 49 | .\mcount ds 2 50 | .\fihelp ds 1 51 | .\mloop1 ldx #$f 52 | .\mloop2 lda \0,x 53 | beq .\mcont1 54 | cmp $fda0,x 55 | beq .\mcont3 56 | inc $fda0,x 57 | .\mcont1 lda $fdb0,x 58 | tay 59 | and #$f 60 | sta .\mcount 61 | lda \0+$10,x 62 | and #$f 63 | beq .\mcont2 64 | cmp .\mcount 65 | beq .\mcont3 66 | inc .\mcount 67 | .\mcont2 tya 68 | and #$f0 69 | sta .\fihelp 70 | lda \0+$10,x 71 | and #$f0 72 | beq .\mcont4a 73 | cmp .\fihelp 74 | beq .\mcont3 75 | lda .\fihelp 76 | clc 77 | adc #$10 78 | .\mcont4a ora .\mcount 79 | sta $fdb0,x 80 | bra .\mcont4 81 | .\mcont3 lda \0,x 82 | sta $fda0,x 83 | lda \0+$10,x 84 | sta $fdb0,x 85 | .\mcont4 dex 86 | bpl .\mloop2 87 | ldy #FADERATE 88 | .\mwait lda $fd0a 89 | bne .\mwait 90 | dey 91 | bne .\mwait 92 | dec .\mcount+1 93 | bne .\mloop1 94 | ELSE 95 | ECHO "FADE_IN :Farbtabelle fehlt !!" 96 | ENDIF 97 | ENDM 98 | -------------------------------------------------------------------------------- /read_regs.py/read_regs.py: -------------------------------------------------------------------------------- 1 | # 2 | # Read registers from BRKserver 3 | # 4 | import serial 5 | import sys 6 | from os.path import exists 7 | 8 | verbose=0 9 | baud=1000000 10 | port='/dev/cu.usbserial-FT63V37G' 11 | 12 | n = len(sys.argv) 13 | 14 | para=1 15 | while para < n-1: 16 | if sys.argv[para] == '-b': 17 | baud = sys.argv[para+1] 18 | para += 2 19 | continue 20 | 21 | if sys.argv[para] == '-p': 22 | port = sys.argv[para+1] 23 | para += 2 24 | continue 25 | 26 | if sys.argv[para] == '-v': 27 | verbose=1 28 | para += 1 29 | continue 30 | 31 | if sys.argv[para] == '-h': 32 | print("read_regs [-v] [-p ] [-b baud] file") 33 | print("Default: ",baud,"Bd Port:",port) 34 | exit(1) 35 | 36 | if exists(port) == False: 37 | print("Error: cannot find:",port) 38 | exit(1) 39 | 40 | command=bytearray(1) 41 | result=bytearray(9+1) 42 | 43 | if verbose == 1: 44 | print("Port:", port,"\nBaud:",baud) 45 | 46 | # Prepare Command 47 | command[0] = 0x86 48 | 49 | ser = serial.Serial(port,baud,parity='E') 50 | ser.write(command) 51 | result=ser.read(9+1); 52 | ser.close() 53 | 54 | p=result[6] 55 | print(f'A:{result[9]:02x}') 56 | print(f'X:{result[8]:02x}') 57 | print(f'Y:{result[7]:02x}') 58 | print(f'P:{p:02x} : ',end="") 59 | ps="" 60 | if p & 0x80 == 0x80: 61 | ps += "N " 62 | else: 63 | ps += "n " 64 | if p & 0x40 == 0x40: 65 | ps += "V " 66 | else: 67 | ps += "v " 68 | ps += "- b " 69 | if p & 0x8 == 0x8: 70 | ps += "D " 71 | else: 72 | ps += "d " 73 | if p & 0x4 == 0x4: 74 | ps += "I " 75 | else: 76 | ps += "i " 77 | if p & 0x2 == 0x2: 78 | ps += "Z " 79 | else: 80 | ps += "z " 81 | if p & 0x1 == 0x1: 82 | ps += "C " 83 | else: 84 | ps += "c " 85 | 86 | print(ps) 87 | print(f'S:{result[5]:02x}') 88 | print(f'PC:{result[3]*256+result[4]:04x}') 89 | print(f'BRK:{result[2]:02x}') 90 | 91 | exit(0) 92 | -------------------------------------------------------------------------------- /macros/suzy.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | PAUSE: SET 1 3 | BUTTON_A SET 2 4 | BUTTON_B SET 4 5 | OPTION_2 SET 8 6 | OPTION_1 SET 16 7 | 8 | macro INITSUZY ; Suzy initalisieren 9 | ifnd SuzyInitFlag 10 | SuzyInitFlag equ 1 11 | ldx #6 12 | .\mloop ldy .\SuzyInitReg,x 13 | lda .\SuzyInitData,x 14 | sta $fc00,y 15 | dex 16 | bpl .\mloop 17 | bra .\mcont 18 | .\SuzyInitReg db $28,$2a,$04,$06,$92,$83,$90 19 | .\SuzyInitData db $7f,$7f,$00,$00,$24,$f3,$01 20 | 21 | .\mcont lda #$24 22 | sta _SPRSYS 23 | endif 24 | endm 25 | 26 | MACRO HOME 27 | stz $fc04 28 | stz $fc06 29 | ENDM 30 | 31 | MACRO READKEY 32 | lda $fcb0 33 | pha 34 | and #$f0 35 | sta Cursor 36 | pla 37 | and #$0f 38 | lsr $fcb1 39 | rol 40 | sta Button 41 | ENDM 42 | 43 | MACRO READJOY ; JoyPad 44 | lda $fcb0 45 | and #$f0 46 | sta Cursor 47 | ENDM 48 | 49 | MACRO READBUTTON 50 | lda $fcb0 51 | and #$0f 52 | lsr $fcb1 53 | rol 54 | sta Button 55 | ENDM 56 | 57 | MACRO WAITKEY 58 | .\WAITKEY0 lda $fcb0 59 | beq .\WAITKEY0 60 | .\WAITKEY1 cmp $fcb0 61 | beq .\WAITKEY1 62 | ENDM 63 | 64 | MACRO WAITNOKEY 65 | .\WAITNOKEY0 lda $fcb0 66 | bne .\WAITNOKEY0 67 | ENDM 68 | 69 | MACRO WAITSUZY 70 | .\WAITSUZY0 bit SPRSYS 71 | bmi .\WAITSUZY0 72 | ENDM 73 | -------------------------------------------------------------------------------- /lynxenc/sizes.h: -------------------------------------------------------------------------------- 1 | /* Atari Lynx Encryption Tool 2 | * Copyright (C) 2009 David Huseby 3 | * 4 | * NOTES: 5 | * 6 | * This software is original software written completely by me, but there are 7 | * pieces of data (e.g. the keys.h and loaders.h files) that I got from the 8 | * Atari Age Lynx Programming forum and from people in the Lynx community, 9 | * namely Karri Kaksonen. Without their help, this would have never been 10 | * possible. I was standing on the shoulders of giants. 11 | * 12 | * LICENSE: 13 | * 14 | * This software is provided 'as-is', without any express or implied warranty. 15 | * In no event will the authors be held liable for any damages arising from the 16 | * use of this software. 17 | * 18 | * Permission is granted to anyone to use this software for any purpose, 19 | * including commercial applications, and to alter it and redistribute it 20 | * freely, subject to the following restrictions: 21 | * 22 | * 1. The origin of this software must not be misrepresented; you must not 23 | * claim that you wrote the original software. If you use this software in a 24 | * product, an acknowledgment in the product documentation would be appreciated 25 | * but is not required. 26 | * 27 | * 2. Altered source versions must be plainly marked as such, and must not be 28 | * misrepresented as being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from any source distribution. 31 | */ 32 | 33 | #ifndef _SIZES_H_ 34 | #define _SIZES_H_ 35 | 36 | #define ENCRYPTED_BLOCK_SIZE (51) 37 | #define PLAINTEXT_BLOCK_SIZE (50) 38 | 39 | #define LYNX_RSA_KEY_SIZE (51) 40 | 41 | #define MAX_BLOCKS_PER_FRAME (5) 42 | 43 | #define ENCRYPTED_FRAME_SIZE(x) (1 + (x * ENCRYPTED_BLOCK_SIZE)) 44 | #define MAX_ENCRYPTED_FRAME_SIZE (1 + (MAX_BLOCKS_PER_FRAME * ENCRYPTED_BLOCK_SIZE)) 45 | 46 | #define PLAINTEXT_FRAME_SIZE(x) (x * PLAINTEXT_BLOCK_SIZE) 47 | 48 | /* this is 256 bytes */ 49 | #define MAX_PLAINTEXT_FRAME_SIZE (6 + (MAX_BLOCKS_PER_FRAME * PLAINTEXT_BLOCK_SIZE)) 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /demos/depacker/unzx0.asm: -------------------------------------------------------------------------------- 1 | ;;; in: 2 | ;;; ZP 3 | ;;; src 4 | ;;; dst 5 | 6 | unzx0:: 7 | stz zx0_offset+1 8 | lda #1 9 | sta zx0_offset 10 | stz zx0_stor 11 | .literal 12 | sec 13 | jsr zx0_elias 14 | .litcpy 15 | jsr zx0_getbyte 16 | jsr zx0_storebyte 17 | bne .litcpy 18 | jsr zx0_getbit 19 | .new_off 20 | php 21 | sec 22 | jsr zx0_elias 23 | plp 24 | bcc .old_offset 25 | 26 | lda zx0_value+1 27 | bne .99 ; > 255 => EOF 28 | 29 | lsr zx0_value 30 | ror 31 | sta zx0_offset 32 | jsr zx0_getbyte 33 | lsr 34 | php 35 | eor #$ff 36 | sec 37 | adc zx0_offset 38 | sta zx0_offset 39 | lda zx0_value 40 | adc #$ff 41 | sta zx0_offset+1 42 | 43 | plp 44 | ldx #$fe ; min count = 2 45 | ldy #$ff 46 | bcs .off2 47 | 48 | //-> clc ; C=0 => no bit reading 49 | jsr zx0_elias 50 | dex ; matchlen + 1 51 | bne .old_offset 52 | dey 53 | .old_offset 54 | sec 55 | .off2 56 | lda dst 57 | sbc zx0_offset 58 | sta zx0_ptr 59 | lda dst+1 60 | sbc zx0_offset+1 61 | sta zx0_ptr+1 62 | .matchcpy 63 | lda (zx0_ptr) 64 | inc zx0_ptr 65 | bne .3 66 | inc zx0_ptr+1 67 | .3 jsr zx0_storebyte 68 | bne .matchcpy 69 | 70 | jsr zx0_getbit 71 | bcs .new_off 72 | bra .literal 73 | 74 | zx0_elias 75 | stz zx0_value+1 76 | lda #1 77 | bcs .el 78 | zx0_elias_pre 79 | jsr zx0_getbit 80 | rol 81 | rol zx0_value+1 82 | .el 83 | jsr zx0_getbit 84 | bcc zx0_elias_pre 85 | .done 86 | sta zx0_value 87 | eor #$ff 88 | inc 89 | tax 90 | lda zx0_value+1 91 | eor #$ff 92 | tay 93 | .99 rts 94 | 95 | zx0_getbit:: 96 | asl zx0_stor 97 | bne .1 98 | tax 99 | jsr zx0_getbyte 100 | sec 101 | rol 102 | sta zx0_stor 103 | txa 104 | .1 105 | rts 106 | 107 | zx0_getbyte:: 108 | lda (src) 109 | inc src 110 | bne .9 111 | inc src+1 112 | .9 rts 113 | 114 | zx0_storebyte:: 115 | sta (dst) 116 | inc dst 117 | bne .9 118 | inc dst+1 119 | .9 inx 120 | bne .99 121 | iny 122 | .99 123 | rts 124 | -------------------------------------------------------------------------------- /etc/lynx.info: -------------------------------------------------------------------------------- 1 | # This is a comment. It extends to the end of the line 2 | GLOBAL { 3 | OUTPUTNAME "rom.s"; 4 | INPUTNAME "LYNX.ROM"; 5 | STARTADDR $FE00; 6 | PAGELENGTH 0; 7 | CPU "65SC02"; 8 | }; 9 | 10 | LABEL { NAME "blockCount"; ADDR $7; }; 11 | LABEL { NAME "ptr"; ADDR 5; SIZE 2;}; 12 | LABEL { NAME "MIKEY"; ADDR $FD00; }; 13 | LABEL { NAME "SYSCTL1"; ADDR $FD87; }; 14 | LABEL { NAME "IODIR"; ADDR $FD8A; }; 15 | LABEL { NAME "IODAT"; ADDR $FD8B; }; 16 | LABEL { NAME "MEMMAP"; ADDR $FFF9; }; 17 | LABEL { NAME "GREEN_F"; ADDR $FDAF; }; 18 | LABEL { NAME "BLUERED_F"; ADDR $FDBF; }; 19 | LABEL { NAME "SDONEACK"; ADDR $FD90; }; 20 | LABEL { NAME "CPUSLEEP"; ADDR $FD91; }; 21 | 22 | LABEL { NAME "SUZY"; ADDR $FC00; }; 23 | LABEL { NAME "SUZYHREV"; ADDR $FC88; }; 24 | LABEL { NAME "RCARD"; ADDR $FCB2; }; 25 | 26 | LABEL { NAME "selSector"; ADDR $FE00; }; 27 | LABEL { NAME "boot"; ADDR $FF80; }; 28 | LABEL { NAME "ClearRAM"; ADDR $FE19; }; 29 | LABEL { NAME "setupMikey"; ADDR $FE26; }; 30 | LABEL { NAME "setupSuzy"; ADDR $FEAA; }; 31 | LABEL { NAME "ramCode"; ADDR $FEC1; }; 32 | LABEL { NAME "sub"; ADDR $FF1E; }; 33 | LABEL { NAME "xx"; ADDR $5000; }; 34 | LABEL { NAME "sub_ram"; ADDR $505D; }; 35 | LABEL { NAME "InsertDate_ram"; ADDR $5092; }; 36 | 37 | RANGE { NAME "RSAKey"; START $FF9A; END $FFCB; TYPE ByteTable; }; 38 | RANGE { NAME "InsertSCB"; START $FF43; END $FF47;TYPE ByteTable; }; 39 | RANGE { NAME "InsertSpritePtr"; START $FF48; END $FF49;TYPE wordTable; }; 40 | RANGE { NAME "InsertSCB2"; START $FF4a; END $FF52; TYPE ByteTable; }; 41 | RANGE { NAME "InsertData"; START $FF53; END $FF7f; TYPE ByteTable; }; 42 | RANGE { NAME "SuzyInitData"; START $FFEF; END $FFF7; TYPE ByteTable; }; 43 | RANGE { NAME "SuzyInitOffset"; START $FFE6; END $FFEE; TYPE ByteTable; }; 44 | 45 | RANGE { NAME "MikeyInitOffset"; START $FFCC; END $FFD7; TYPE ByteTable; }; 46 | RANGE { NAME "MikeyInitData"; START $FFD8; END $FFE5; TYPE ByteTable; }; 47 | #RANGE { NAME "INSERT_GAME"; START $FF4C; END $FF7F; TYPE ByteTable; }; 48 | RANGE { START $FFFA; END $FFFF; TYPE WORDTABLE; }; 49 | 50 | -------------------------------------------------------------------------------- /sendobj.js/sendobj.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* sendobj as node.js */ 4 | 5 | const SerialPort = require('serialport'); 6 | const fs = require('fs'); 7 | const InterByteTimeoutParser = require('@serialport/parser-inter-byte-timeout') 8 | const ByteLengthParser = require('@serialport/parser-byte-length') 9 | var defaultPort = 'COM7' 10 | var defaultBaudrate = 62500 11 | 12 | var argc = process.argv.length - 2 13 | var index = 2 14 | 15 | function done() 16 | { 17 | process.exit(0); 18 | } 19 | 20 | while ( argc > 1 ) { 21 | if ( process.argv[index] === '-p' && argc > 1 ){ 22 | defaultPort = process.argv[index+1] 23 | argc -= 2 24 | index += 2 25 | } else if ( process.argv[index] === '-b' && argc > 1 ){ 26 | defaultBaudrate = parseInt(process.argv[index+1]) 27 | argc -= 2 28 | index += 2 29 | } 30 | } 31 | if ( process.argv[index] ) { 32 | var file = process.argv[index] 33 | } else { 34 | console.log("Error: Missing file") 35 | return 36 | } 37 | 38 | const port = new SerialPort(defaultPort, { 39 | baudRate: defaultBaudrate, 40 | parity:'even' 41 | }) 42 | 43 | port.on('error',function(err) { 44 | console.log('Error ', err.message) 45 | }) 46 | 47 | if ( defaultBaudrate != 1000000 ){ 48 | const parser = port.pipe(new InterByteTimeoutParser({ interval: 1})) 49 | } 50 | 51 | try { 52 | var buffer = fs.readFileSync(file) 53 | } catch( err ) { 54 | console.error(err) 55 | return 56 | } 57 | var header = Uint8Array.from([0x81, 0x50 /*P*/, 0,0, 0,0]) 58 | var len = (buffer[4]<<8) + buffer[5]-10 59 | 60 | header[2] = buffer[2]; // destination low byte 61 | header[3] = buffer[3]; // destination high byte 62 | header[4] = (len >> 8) ^ 0xff // length high byte prepared for inc 63 | header[5] = (len & 0xff) ^ 0xff // length low byte prepared for inc 64 | 65 | if ( !port.write(header, 'binary') ) { 66 | console.log("KO\n"); 67 | return 68 | } 69 | 70 | buffer = buffer.slice(10); // skip BLL header 71 | 72 | const parser = port.pipe(new ByteLengthParser({ length: len })) 73 | parser.on('data', done) // event when all bytes are written. 74 | 75 | var ok = port.write(buffer, 'binary') 76 | if ( !ok ) { 77 | console.log("KO\n"); 78 | process.exit(0); 79 | } 80 | port.drain(); 81 | -------------------------------------------------------------------------------- /demos/depacker/unlz4_fast.asm: -------------------------------------------------------------------------------- 1 | ;;; in: 2 | ;;; ZP 3 | ;;; src 4 | ;;; dst 5 | ;;; A:Y packed length 6 | 7 | LZ4_MAX_LEN_256 EQU 0 8 | 9 | unlz4:: 10 | .token 11 | jsr lz4_getbyte 12 | sta .smc+1 13 | lsr 14 | lsr 15 | lsr 16 | lsr 17 | beq .match 18 | jsr lz4_getlen 19 | .litloop 20 | lda (src),y 21 | sta (dst),y 22 | iny 23 | IF LZ4_MAX_LEN_256 = 0 24 | beq .incptrlit 25 | .21 26 | ENDIF 27 | inx 28 | bne .litloop 29 | inc lz4_tmp 30 | bne .litloop 31 | 32 | clc 33 | tya 34 | adc dst 35 | sta dst 36 | bcc .9 37 | inc dst+1 38 | .9 39 | clc 40 | tya 41 | adc src 42 | sta src 43 | bcc .91 44 | inc src+1 45 | .91 46 | .match 47 | clc 48 | jsr lz4_getbyte 49 | tay 50 | sbc dst 51 | eor #$ff 52 | sta lz4_ptr 53 | 54 | jsr lz4_getbyte 55 | tax 56 | sbc dst+1 57 | eor #$ff 58 | sta lz4_ptr+1 59 | 60 | tya 61 | bne .notdone 62 | txa 63 | beq ._rts 64 | .notdone 65 | .smc 66 | lda #10 67 | and #15 68 | jsr lz4_getlen 69 | sec 70 | txa 71 | sbc #4 72 | tax 73 | bcs .1 74 | dec lz4_tmp 75 | .1 76 | .matchloop 77 | lda (lz4_ptr),y 78 | sta (dst),y 79 | iny 80 | IF LZ4_MAX_LEN_256 = 0 81 | beq .incptr 82 | .2 83 | ENDIF 84 | inx 85 | bne .matchloop 86 | inc lz4_tmp 87 | bne .matchloop 88 | clc 89 | tya 90 | adc dst 91 | sta dst 92 | bcc .token 93 | inc dst+1 94 | bra .token 95 | 96 | IF LZ4_MAX_LEN_256 = 0 97 | .incptr 98 | inc lz4_ptr+1 99 | inc dst+1 100 | bra .2 101 | .incptrlit 102 | inc src+1 103 | inc dst+1 104 | bra .21 105 | ENDIF 106 | 107 | ENDIF 108 | 109 | lz4_getlen 110 | ldy #$ff 111 | cmp #15 112 | bne .noext 113 | sta lz4_tmp 114 | .loop 115 | jsr lz4_getbyte 116 | IF LZ4_MAX_LEN_256 = 0 117 | cmp #$ff 118 | beq .33 119 | ENDIF 120 | clc 121 | adc lz4_tmp 122 | bcc .3 123 | dey 124 | .3 125 | .noext 126 | eor #$ff 127 | tax 128 | inx 129 | bne .4 130 | iny 131 | .4 132 | sty lz4_tmp 133 | ldy #0 134 | ._rts 135 | rts 136 | IF LZ4_MAX_LEN_256 = 0 137 | .33 138 | dec lz4_tmp 139 | dey 140 | bra .loop 141 | ENDIF 142 | lz4_getbyte:: 143 | lda (src) 144 | inc src 145 | beq .9 146 | rts 147 | .9 148 | inc src+1 149 | rts 150 | -------------------------------------------------------------------------------- /macros/window.mac: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | MACRO DEFLCB ; LineControlBlock definieren 3 | IF SCR_MAX_X>255 ; X 4 | dw \0 5 | ELSE 6 | db <(\0) 7 | ENDIF 8 | IF SCR_MAX_Y>255 ; Y 9 | dw \1 10 | ELSE 11 | db <(\1) 12 | ENDIF 13 | IF SCR_MAX_X>255 ; W 14 | dw \2 15 | ELSE 16 | db <(\2) 17 | ENDIF 18 | IF SCR_MAX_Y>255 ; H 19 | dw \3 20 | ELSE 21 | db <(\3) 22 | ENDIF 23 | db \4 ; Color 24 | IFVAR \5 25 | db \5 26 | ELSE 27 | db 1 28 | ENDIF 29 | ENDM 30 | 31 | 32 | MACRO DEFWCB ; WindowControlBlock definieren 33 | IF SCR_MAX_X>255 ; X 34 | dw \0 35 | ELSE 36 | db <(\0) 37 | ENDIF 38 | IF SCR_MAX_Y>255 ; Y 39 | dw \1 40 | ELSE 41 | db <(\1) 42 | ENDIF 43 | IF SCR_MAX_X>255 ; W 44 | dw \2 45 | ELSE 46 | db <(\2) 47 | ENDIF 48 | IF SCR_MAX_Y>255 ; H 49 | dw \3 50 | ELSE 51 | db <(\3) 52 | ENDIF 53 | IFVAR \4 54 | db \4 ; Color 55 | ELSE 56 | ECHO "DEFWCB : Farbe fehlt" 57 | db 0 58 | ENDIF 59 | IFVAR \5 60 | db \5 ; Rahmen-Farbe 61 | ELSE 62 | ECHO "DEFWCB : Rahmen-Farbe fehlt" 63 | db 15 64 | ENDIF 65 | IFVAR \6 66 | db \6 ; Rahmen-Dicke 67 | ELSE 68 | db 1 69 | ENDIF 70 | ENDM 71 | 72 | MACRO CLS 73 | CLSuser SET 1 74 | IFVAR \0 75 | LDA \0 76 | ENDIF 77 | jsr cls 78 | ENDM 79 | 80 | MACRO WINDOW 81 | IFVAR \0 82 | lda #<(\0) 83 | ldy #>(\0) 84 | ENDIF 85 | jsr OpenWindow 86 | ENDM 87 | 88 | MACRO RECTANGLE 89 | IFVAR \0 90 | lda #<(\0) 91 | ldy #>(\0) 92 | ENDIF 93 | jsr Rectangle 94 | ENDM 95 | MACRO BOX ; X,Y,W,H,C 96 | lda #<(\0) 97 | sta TempLCB+LineX 98 | lda #<(\2) 99 | sta TempLCB+LineW 100 | IF SCR_MAX_X>255 101 | lda #>(\0) 102 | sta TempLCB+LineX+1 103 | lda #>(\2) 104 | sta TempLCB+LineW+1 105 | ENDIF 106 | lda #<(\1) 107 | sta TempLCB+LineY 108 | lda #<(\3) 109 | sta TempLCB+LineH 110 | IF SCR_MAX_Y>255 111 | lda #>(\1) 112 | sta TempLCB+LineY+1 113 | lda #<(\3) 114 | sta TempLCB+LineH+1 115 | ENDIF 116 | IFVAR \4 117 | LDA #\4 118 | ELSE 119 | lda FG_Color 120 | ENDIF 121 | sta TempLCB+LineColor 122 | lda #1 123 | sta TempLCB+LineWidth 124 | jsr Rectangle0 125 | ENDM 126 | 127 | MACRO PLOT 128 | PlotUser SET 1 129 | IFVAR \0 130 | lda #<(\0) 131 | ldy #>(\0) 132 | ENDIF 133 | jsr Plot 134 | ENDM 135 | -------------------------------------------------------------------------------- /macros/overlay.mac: -------------------------------------------------------------------------------- 1 | ; -*-asm-*- 2 | ;;; Macros to help building a ROM with overlays to be loaded during 3 | ;;; runtime 4 | 5 | ;;; 6 | ;;; Align the ROM PC on the next block for fast loading of the 7 | ;;; next overlay 8 | ;;; 9 | MACRO ROM_BLOCK_ALIGN 10 | ALIGN_ROM_PC set (BlockSize-(ROM_PC & (BlockSize-1))) 11 | ROM_PC set ROM_PC + ALIGN_ROM_PC 12 | 13 | REPT ALIGN_ROM_PC 14 | IFVAR \0 15 | dc.b \0 16 | ELSE 17 | dc.b $ff 18 | ENDIF 19 | ENDR 20 | ENDM 21 | 22 | ;;; 23 | ;;; Start a new overlay 24 | ;;; Parameter 25 | ;;; name of the overlay (must be a legal symbol) 26 | ;;; addres in RAM where to run 27 | ;;; 28 | MACRO OVERLAY_BEGIN ; name, code-address 29 | ROM_\0 equ ROM_PC 30 | run \1 31 | start_\0:: 32 | ENDM 33 | 34 | ;;; 35 | ;;; Close an overlay 36 | ;;; Parameter 37 | ;;; name of the overlay (must be the same as for OVERLAY_BEGIN 38 | ;;; 39 | MACRO OVERLAY_END ; name 40 | end_\0:: 41 | size_\0:: equ end_\0 - start_\0 42 | ROM_PC set ROM_PC+size_\0 43 | ENDM 44 | 45 | ;;; 46 | ;;; Helpers to build the directory tables 47 | ;;; 48 | ;;; Parameter 49 | ;;; Name of the overlay (same as for BEGIN and END) 50 | ;;; 51 | MACRO OVERLAY_BLOCK ; name 52 | dc.b ROM_\0 / BlockSize 53 | ENDM 54 | 55 | MACRO OVERLAY_OFFSET_LO 56 | dc.b (<(ROM_\0 & (BlockSize-1)))^$ff 57 | ENDM 58 | 59 | MACRO OVERLAY_OFFSET_HI 60 | dc.b (>(ROM_\0 & (BlockSize-1)))^$ff 61 | ENDM 62 | 63 | MACRO OVERLAY_SIZE_LO 64 | dc.b (size_\0)^$ff 69 | ENDM 70 | 71 | MACRO OVERLAY_DEST_LO 72 | dc.b (start_\0) 77 | ENDM 78 | 79 | ;;; 80 | ;;; Classic directory entry (reverse order!) 81 | ;;; 82 | ;;; Parameter 83 | ;;; Name of the overlay (same as for BEGIN and END) 84 | ;;; exec flag (optional) : $88 => code, $89 TP packed code 85 | ;;; 86 | ;; StartBlock db 0 87 | ;; BlockOffset dw 0 88 | ;; ExecFlag db 0 89 | ;; DestAddr dw 0 90 | ;; FileLen dw 0 91 | 92 | MACRO OVERLAY_DIR_ENTRY 93 | dc.b (>size_\0)^$ff 94 | dc.b (start_\0) 96 | dc.b ((ROM_\0 & (BlockSize-1)))^$ff 103 | dc.b (<(ROM_\0 & (BlockSize-1)))^$ff 104 | dc.b ROM_\0 / BlockSize 105 | ENDM 106 | -------------------------------------------------------------------------------- /demos/fonttst2.asm: -------------------------------------------------------------------------------- 1 | include 2 | 3 | include 4 | include 5 | include 6 | include 7 | include 8 | 9 | include 10 | include 11 | include 12 | 13 | BEGIN_MEM 14 | ALIGN 4 15 | screen0 ds SCREEN.LEN 16 | END_MEM 17 | run LOMEM 18 | INITMIKEY 19 | INITSUZY 20 | SETRGB pal 21 | cli 22 | SCRBASE screen0 23 | lda #0 24 | jsr cls 25 | PRINT test 26 | INC_CURRY 4*13 27 | PRINT test2 28 | .l inc $fdaf 29 | bra .l 30 | 31 | cls:: pha 32 | phx 33 | phy 34 | stz $fc04 35 | stz $fc06 36 | sta .CLScolor 37 | lda #<.CLSscb 38 | ldy #>.CLSscb 39 | jsr DrawSprite 40 | SET_XY 0,0 ; set cursor 41 | ply 42 | plx 43 | pla 44 | rts 45 | 46 | .CLSscb db $00,$10,00 47 | dw 0 48 | dw .CLSdata 49 | dw 0,0 50 | dw 10*$100,102*$100 51 | .CLScolor db $0F 52 | .CLSdata db 2,%01111100,0 53 | 54 | 55 | 56 | test DEFTEXT text,textpuff,SMALLFNT2,NO_FLIP,NORMAL_SIZE,NORMAL_SIZE,15 57 | text db "ABCDEFGHIJKLMNOPQRSTUVWXYZ",255 58 | db "abcdefghijklmnopqrstuvwxyz",255 59 | db "1234567890!",34,"$%&/()=",255 60 | db "?'`#^[]{}~|_-:.;,<>",255 61 | db "Bastian Schick",255 62 | db "Brunnengasse 7 6*4+(19-4/2)=4x",0 63 | 64 | 65 | test2 DEFTEXT text2,textpuff,SMALLFNT2,NO_FLIP,NORMAL_SIZE,NORMAL_SIZE,14 66 | text2 db "Chaneil an t-adhar os cion",13 67 | db "Lunnainn a nochd soilleir no dorch",13 68 | db "(c) Runrig / The Big Wheel",0 69 | 70 | ;win1 DEFWCB 2,2,157,99,0,9,2 71 | 72 | include 73 | include 74 | include 75 | 76 | pal STANDARD_PAL 77 | textpuff equ * 78 | -------------------------------------------------------------------------------- /uBLL/bll_2nd_stage.asm: -------------------------------------------------------------------------------- 1 | *************** 2 | * Mini COMLynx Loader (not size optimized) 3 | * 2nd stage 4 | **************** 5 | 6 | include 7 | 8 | Baudrate EQU 62500 9 | 10 | ;;; ROM sets this address 11 | screen0 equ $2000 12 | 13 | MACRO READ_BYTE 14 | .\w 15 | bit $fd8c 16 | bvc .\w 17 | lda $fd8d 18 | ENDM 19 | 20 | run $100-1 21 | Start:: 22 | dc.b size ; needed for 1st stage 23 | ldx #12-1 24 | .sloop 25 | ldy SUZY_addr,x 26 | lda SUZY_data,x 27 | sta $fc00,y 28 | dex 29 | bpl .sloop 30 | 31 | ldx #7-1 32 | .mloop 33 | ldy MIKEY_addr,x 34 | lda MIKEY_data,x 35 | sta $fd00,y 36 | dex 37 | bpl .mloop 38 | 39 | lda $fcb0 40 | bne .noturbo 41 | dec $fda0 42 | lda #%00010000 43 | sta $FD9C ; MTEST0: UARTturbo 44 | .noturbo 45 | 46 | wait: 47 | READ_BYTE 48 | cmp #0x81 49 | bne wait 50 | READ_BYTE 51 | cmp #'P' 52 | bne wait 53 | 54 | load_len equ $0 55 | load_ptr equ $2 56 | load_len2 equ $4 57 | load_ptr2 equ $6 58 | 59 | Loader:: 60 | ldy #4 61 | .loop0 READ_BYTE 62 | sta load_len-1,y 63 | sta load_len2-1,y ; mirror for call 64 | dey 65 | bne .loop0 ; get destination and length 66 | tax ; lowbyte of length 67 | 68 | .loop1 inx 69 | bne .1 70 | inc load_len+1 71 | bne .1 72 | jmp (load_ptr) 73 | 74 | .1 READ_BYTE 75 | sta (load_ptr2),y 76 | sta $fdb0 77 | iny 78 | bne .loop1 79 | inc load_ptr2+1 80 | bra .loop1 81 | ;;;------------------------------ 82 | ;; Writing low-byte in SUZY space clears highbyte! 83 | _SDONEACK EQU SDONEACK-$fd00 84 | _CPUSLEEP EQU CPUSLEEP-$fd00 85 | MIKEY_addr 86 | dc.b $10,$11,$8c,_CPUSLEEP,_SDONEACK,$b3,$a0 87 | 88 | MIKEY_data 89 | dc.b 125000/Baudrate-1,%11000,%11101,0,0,$0f,0 90 | 91 | _SCBNEXT EQU SCBNEXT-$fc00 92 | _SPRGO EQU SPRGO-$fc00 93 | SUZY_addr 94 | db _SPRGO,_SCBNEXT+1,_SCBNEXT,$09,$08,$04,$06,$28,$2a,$83,$92,$90 95 | SUZY_data 96 | db 1,>plot_SCB,Tank,>Bombe,>Gras,>Leer,>Fahne,>Dead,>Bullet,>Clock 104 | dc.b >Bombe 105 | 106 | SprColor01 dc.b $03,$03,$03,$07,$03,$0f,$00,$00,$07 107 | SprColor23 dc.b $17,$19,$33,$27,$81,$91,$17,$F7,$19 108 | SprColor45 dc.b $00,$70,$00,$00,$9E,$00,$f0,$90,$70 109 | 110 | _10 dc.b 0,10,20,30,40,50,60,70,80,90 111 | dc.b 100,110,120,130,140,150 112 | 113 | ; 3Bit and unpacked 114 | 115 | path "sprites\" 116 | Tank ibytes "tank.o" 117 | Bombe ibytes "bombe.o" 118 | Gras ibytes "gras.o" 119 | Leer ibytes "leer.o" 120 | Fahne ibytes "fahne.o" 121 | Dead ibytes "dead.o" 122 | Bullet ibytes "bullet.o" 123 | Clock ibytes "clock.o" 124 | path ".." 125 | 126 | -------------------------------------------------------------------------------- /demos/spriteed/spriteed.lst: -------------------------------------------------------------------------------- 1 | DEFINT "a-z" 2 | DIM sprite(8,16) 3 | BOX 0,0,480,306 4 | BOX 0,52*3,32*3,52*3+32*3 5 | LINE 0,60*3,32*3,60*3 6 | LINE 0,68*3,32*3,68*3 7 | LINE 0,76*3,32*3,76*3 8 | LINE 8*3,52*3,8*3,84*3 9 | LINE 16*3,52*3,16*3,84*3 10 | LINE 24*3,52*3,24*3,84*3 11 | BOX (80-16)*3,(52-16)*3,(80+16)*3,(52+16)*3 12 | BOX 0,90*3,16*4*3,101*3 13 | WHILE BIOS(1,1) 14 | VOID INP(1) 15 | WEND 16 | p$="\" 17 | DO 18 | SHOWM 19 | @getmouse(*x,*y,*k) 20 | IF ABS(x-ax)>0 OR ABS(y-ay)>0 OR k<>ak 21 | ax=x 22 | ay=y 23 | ak=k 24 | sendxyk(x,y,k) 25 | ENDIF 26 | IF BIOS(1,1) 27 | a=INP(1) 28 | IF a=&HAC 29 | get_sprite 30 | ENDIF 31 | IF a=&HAB 32 | send_sprite 33 | ENDIF 34 | ENDIF 35 | LOOP 36 | > PROCEDURE getmouse(x,y,k) 37 | LOCAL a,b,c 38 | MOUSE a,b,c 39 | IF a>479 40 | a=479 41 | ENDIF 42 | IF b>305 43 | b=305 44 | ENDIF 45 | a=ROUND(a DIV 3) 46 | b=ROUND(b DIV 3) 47 | PRINT AT(1,1);a,b 48 | *x=a 49 | *y=b 50 | *k=c 51 | RETURN 52 | PROCEDURE sendxyk(a,b,c) 53 | OUT 1,170 54 | VOID INP(1) 55 | OUT 1,a 56 | VOID INP(1) 57 | OUT 1,b 58 | VOID INP(1) 59 | ' OUT 1,SHL(c AND 1,1) OR SHR(c AND 2,1) 60 | OUT 1,c 61 | VOID INP(1) 62 | RETURN 63 | > PROCEDURE send_sprite 64 | ARRAYFILL sprite(),0 65 | FILESELECT p$+"*.sps","",a$ 66 | IF EXIST(a$) 67 | p$=LEFT$(a$,RINSTR(a$,"\")) 68 | CLR y 69 | OPEN "i",#1,a$ 70 | WHILE (NOT EOF(#1)) AND y<16 71 | INPUT #1,b$ 72 | IF LEN(b$) AND 1 73 | b$=b$+"0" 74 | ENDIF 75 | IF LEN(b$)>16 76 | b$=LEFT$(b$,16) 77 | ENDIF 78 | PRINT b$ 79 | FOR i=1 TO LEN(b$) 80 | IF MID$(b$,i,1)=" " 81 | MID$(b$,i,1)="0" 82 | ENDIF 83 | NEXT i 84 | FOR i=0 TO LEN(b$)/2-1 85 | a=VAL("&"+MID$(b$,1+i*2,2)) 86 | sprite(i,y)=a 87 | NEXT i 88 | INC y 89 | WEND 90 | CLOSE 91 | PRINT x,y 92 | FOR y=0 TO 15 93 | FOR x=0 TO 7 94 | OUT 1,sprite(x,y) 95 | VOID INP(1) 96 | NEXT x 97 | NEXT y 98 | ENDIF 99 | RETURN 100 | > PROCEDURE get_sprite 101 | FOR y=0 TO 15 102 | FOR x=0 TO 7 103 | IF BIOS(1,1) 104 | sprite(x,y)=INP(1) 105 | ENDIF 106 | NEXT x 107 | NEXT y 108 | FILESELECT p$+"*.sps","",a$ 109 | IF NOT EXIST(a$) 110 | p$=LEFT$(a$,RINSTR(a$,"\")) 111 | OPEN "o",#1,a$ 112 | FOR y=0 TO 15 113 | FOR x=0 TO 7 114 | PRINT #1,HEX$(sprite(x,y),2); 115 | NEXT x 116 | PRINT #1 117 | NEXT y 118 | CLOSE 119 | ENDIF 120 | RETURN 121 | -------------------------------------------------------------------------------- /includes/sample.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | * Sample 3 | * Date changes 4 | * 28.11.94 InitSample stops SampleTimer 5 | * 17.07.96 added STZ $FD22 (mute) in StopSampleIRQ (rm glitch) 6 | 7 | *************** 8 | * start Sample 9 | * IN : A file-number 10 | *************** 11 | StartSample:: nop 12 | stz $fd22 13 | stz $FD01+SmpTimer*4 ; stop curr. Sample 14 | jsr OpenFile 15 | SETIRQVEC SmpTimer,PlayMonoU 16 | jsr ReadByte 17 | tax 18 | beq .ok 19 | SETIRQVEC SmpTimer,PlayMono 20 | stz SmpTemp 21 | stz SmpSema 22 | stz SmpTemp2 23 | .ok jsr ReadByte 24 | eor #$ff 25 | sta DigiCount+2 26 | jsr ReadByte 27 | eor #$ff 28 | sta DigiCount+1 29 | jsr ReadByte 30 | eor #$ff 31 | sta DigiCount 32 | jsr ReadByte 33 | sta $fd00+SmpTimer*4 34 | 35 | lda $fd50 36 | and #$EE 37 | sta $fd50 ; Kanal A an 38 | jsr ReadByte ; Stereo-Flag weg 39 | lda #%10011000 40 | sta $fd01+SmpTimer*4 41 | rts 42 | StopSample stz $fd01+SmpTimer*4 43 | rts 44 | *************** 45 | * MONO-Sample 46 | *************** 47 | PlayMonoU:: jsr ReadByte 48 | sta $fd22 49 | .cont1 inc DigiCount 50 | beq .next0 51 | END_IRQ 52 | .next0 inc DigiCount+1 53 | beq .next1 54 | END_IRQ 55 | .next1 inc DigiCount+2 56 | beq StopSampleIRQ 57 | END_IRQ 58 | 59 | StopSampleIRQ stz $fd01+SmpTimer*4 60 | stz $fd22 ; mute ( added 170796 ) 61 | lda $fd50 62 | ora #$11 63 | sta $fd50 ; channel A off 64 | END_IRQ 65 | *************** 66 | * packed Mono-Sample 67 | *************** 68 | PlayMono:: lda SmpSema 69 | bne .no_read 70 | dec SmpSema 71 | jsr ReadByte 72 | sta SmpTemp2 73 | REPT 4 74 | lsr 75 | ENDR 76 | tax 77 | clc 78 | lda tabelle,x 79 | adc SmpTemp 80 | sta SmpTemp 81 | sta $fd22 82 | 83 | .cont1 inc DigiCount 84 | beq .next0 85 | END_IRQ 86 | .next0 inc DigiCount+1 87 | beq .next1 88 | END_IRQ 89 | .next1 inc DigiCount+2 90 | beq StopSampleIRQ 91 | END_IRQ 92 | 93 | .no_read stz SmpSema 94 | 95 | lda SmpTemp2 96 | and #$f 97 | tax 98 | clc 99 | lda tabelle,x 100 | adc SmpTemp 101 | sta SmpTemp 102 | sta $fd22 103 | END_IRQ 104 | 105 | tabelle DC.B 128,-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64 106 | *************** 107 | * prepare channel A 108 | * prepare Timer 109 | *************** 110 | InitSample:: stz $fd01+SmpTimer*4 111 | 112 | lda $fd44 113 | ora #$11 114 | sta $fd44 ; channel A - panning 115 | 116 | lda #$ff ; full volume right/left 117 | sta $fd40 118 | 119 | ; lda #$77 120 | ; sta $fd42 ; channel C half volume right/left 121 | 122 | lda $fd50 123 | ora #$11 124 | sta $fd50 ; channel A quite 125 | 126 | stz $fd22 127 | stz $fd25 ; Audio-Contrl A 128 | stz $fd24 129 | rts 130 | -------------------------------------------------------------------------------- /demos/depacker/untsc.asm: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; depacker for TSCrunch, based on Antonio Savona's 6502 version. 3 | ;; 4 | ;; IN: tsget - packed data 5 | ;; tsput - destination 6 | ;; 7 | //->SMALL EQU 1 8 | 9 | untsc:: 10 | lda (tsget) 11 | IFD SMALL 12 | pha 13 | ELSE 14 | sta optRun+1 15 | ENDIF 16 | ldx #1 17 | bra putnoof 18 | entry2: 19 | lda (tsget) 20 | bmi rleorlz 21 | cmp #$20 22 | bcs lz2 23 | tax 24 | tay 25 | ts_delit_loop: 26 | lda (tsget),y 27 | dey 28 | sta (tsput),y 29 | bne ts_delit_loop 30 | txa 31 | inx 32 | updatezp_noclc: 33 | iny 34 | updatezp_noclc2: 35 | adc tsput 36 | sta tsput 37 | IFD SMALL 38 | bcc putnoof 39 | inc tsput+1 40 | ELSE 41 | bcs updateput_hi 42 | ENDIF 43 | putnoof: 44 | clc 45 | txa 46 | uptdate_getonly: 47 | adc tsget 48 | sta tsget 49 | bcc entry2 50 | inc tsget+1 51 | bra entry2 52 | IFND SMALL 53 | updateput_hi: 54 | inc tsput+1 55 | bra putnoof 56 | ENDIF 57 | 58 | rleorlz: 59 | ldx #2 60 | and #$7f 61 | lsr 62 | bcc ts_delz 63 | // RLE 64 | beq optRun 65 | plain: 66 | IFD SMALL 67 | pha 68 | pha 69 | lda (tsget),y 70 | ply 71 | ELSE 72 | sta tstemp ; count 73 | lda (tsget),y 74 | ldy tstemp 75 | ENDIF 76 | runStart: 77 | sta (tsput),y 78 | ts_derle_loop: 79 | dey 80 | sta (tsput),y 81 | bne ts_derle_loop 82 | IFD SMALL 83 | pla 84 | ELSE 85 | lda tstemp 86 | ENDIF 87 | bra updatezp_noclc 88 | lz2: 89 | beq done ; == $20 90 | ora #$80 91 | adc tsput 92 | IFD SMALL 93 | ldx #1 94 | stx lzto+1 95 | bra lz2_put 96 | ELSE 97 | sta lzput 98 | lda tsput+1 99 | sbc #$0 100 | sta lzput+1 101 | lda (lzput) 102 | sta (tsput) 103 | lda (lzput),y 104 | sta (tsput),y 105 | 106 | tya 107 | tax 108 | bra updatezp_noclc2 109 | ENDIF 110 | // LZ 111 | ts_delz: 112 | lsr 113 | sta lzto+1 114 | lda tsput 115 | bcc long 116 | sbc (tsget),y 117 | lz2_put: 118 | sta lzput 119 | lda tsput+1 120 | sbc #$0 121 | lz_put: 122 | sta lzput+1 123 | 124 | IFD SMALL 125 | ldy #$ff 126 | ELSE 127 | lda (lzput) 128 | sta (tsput) 129 | ldy #0 130 | ENDIF 131 | ts_delz_loop: 132 | iny 133 | lda (lzput),y 134 | sta (tsput),y 135 | lzto: 136 | cpy #0 137 | bne ts_delz_loop 138 | tya 139 | ldy #0 140 | bra updatezp_noclc 141 | optRun: 142 | IFD SMALL 143 | ply 144 | phy 145 | phy 146 | ELSE 147 | ldy #255 148 | sty tstemp 149 | ENDIF 150 | dex 151 | bra runStart 152 | 153 | long: 154 | adc (tsget),y 155 | sta lzput 156 | iny 157 | lda (tsget),y 158 | tay 159 | ora #$80 160 | adc tsput+1 161 | cpy #$80 162 | rol lzto+1 163 | inx 164 | bra lz_put 165 | done: 166 | IFD SMALL 167 | ply 168 | ENDIF 169 | rts 170 | -------------------------------------------------------------------------------- /includes/random.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | ************************** 3 | * ZUFALL 4 | * (c) 1994 Bastian Schick 5 | * erstellt : 260694- 6 | ************************** 7 | 8 | InitRandom:: 9 | lda $fd0A 10 | sta seed_lo 11 | adc $fd02 12 | sta seed_lo+1 13 | adc $fd02 14 | sta seed_lo+2 15 | adc $fd02 16 | and #$3f 17 | sta seed_hi 18 | adc $fd02 19 | and #$3f 20 | sta seed_hi+1 21 | adc $fd02 22 | and #$3f 23 | sta seed_hi+2 24 | Random:: 25 | phx 26 | phy 27 | lda _SPRSYS 28 | ora #$C0 ; mit Vorzeichen und Akku 29 | sta $fc92 30 | ldx #0 31 | jsr compute_seed 32 | inx 33 | jsr compute_seed 34 | inx 35 | jsr compute_seed 36 | sec 37 | lda seed_lo 38 | sbc seed_lo+1 39 | sta rnd_rest 40 | lda seed_hi 41 | sbc seed_hi+1 42 | sta rnd_rest+1 ; z=seed1-seed2 43 | beq .ok 44 | cmp #>706 45 | blt .ok 46 | bne .ko 47 | lda rnd_rest 48 | cmp #<706 49 | blt .ok 50 | .ko sbc #<32362 51 | sta rnd_rest 52 | lda rnd_rest+1 53 | sbc #>32362 54 | sta rnd_rest+1 55 | .ok clc 56 | lda rnd_rest 57 | adc seed_lo+2 58 | sta rnd_rest 59 | lda rnd_rest+1 60 | adc seed_hi+2 61 | bmi .ko1 62 | bne .ok1 63 | lda rnd_rest 64 | dec 65 | bne .ok1 66 | .ko1 clc 67 | lda rnd_rest 68 | adc #<32362 69 | sta rnd_rest 70 | lda rnd_rest+1 71 | adc #>32362 72 | sta rnd_rest+1 73 | .ok1 lda _SPRSYS 74 | sta $fc92 75 | ply 76 | plx 77 | lda rnd_rest 78 | rts 79 | 80 | compute_seed:: 81 | lda rnd_divisor,x 82 | sta MATHE_B 83 | stz MATHE_B+1 84 | lda seed_lo,x 85 | sta MATHE_A 86 | lda seed_hi,x 87 | sta MATHE_A+1 88 | stz MATHE_A+2 89 | stz MATHE_A+3 90 | .wait bit $fc92 91 | bmi .wait 92 | clc 93 | lda MATHE_R+1 94 | lsr 95 | sta rnd_rest+1 96 | lda MATHE_R 97 | ror 98 | sta rnd_rest ; rnd_rest := A MOD B 99 | stz MATHE_AKKU 100 | stz MATHE_AKKU+2 101 | lda rnd_mult1,x 102 | sta MATHE_E 103 | lda #$FF 104 | sta MATHE_E+1 105 | .wait1 bit $fc92 106 | bmi .wait1 ; AKKU = -mult1*(A DIV B) 107 | lda rnd_rest 108 | sta MATHE_C 109 | lda rnd_rest+1 110 | sta MATHE_C+1 111 | lda rnd_mult2,x 112 | sta MATHE_E 113 | stz MATHE_E+1 114 | .wait2 bit $fc92 115 | bmi .wait2 116 | ldy MATHE_AKKU+1 117 | tya 118 | sta seed_hi,x 119 | lda MATHE_AKKU 120 | sta seed_lo,x 121 | tya 122 | bpl .exit 123 | clc 124 | lda seed_lo,x 125 | adc rnd_add_lo,x 126 | sta seed_lo,x 127 | lda seed_hi,x 128 | adc rnd_add_hi,x 129 | sta seed_hi,x 130 | .exit rts 131 | 132 | rnd_mult1 dc.b -21,-45,$7B 133 | rnd_mult2 dc.b 157,146,142 134 | rnd_divisor dc.b 206,217,222 135 | rnd_add_lo dc.b <32363,<31727,<31657 136 | rnd_add_hi dc.b >32363,>31727,>31657 137 | 138 | rnd_rest 139 | seed_lo dc.b 1,2,3 140 | seed_hi dc.b 4,5,6 141 | -------------------------------------------------------------------------------- /bin/sintab_8.asm: -------------------------------------------------------------------------------- 1 | * sine-table : 8 bit fix-point 2 | * assemble with option -d 3 | 4 | run 0 5 | SinTab.Lo 6 | DC.B $00,$06,$0D,$13,$19,$1F,$26,$2C 7 | DC.B $32,$38,$3E,$44,$4A,$50,$56,$5C 8 | DC.B $62,$68,$6D,$73,$79,$7E,$84,$89 9 | DC.B $8E,$93,$98,$9D,$A2,$A7,$AC,$B1 10 | DC.B $B5,$B9,$BE,$C2,$C6,$CA,$CE,$D1 11 | DC.B $D5,$D8,$DC,$DF,$E2,$E5,$E7,$EA 12 | DC.B $ED,$EF,$F1,$F3,$F5,$F7,$F8,$FA 13 | DC.B $FB,$FC,$FD,$FE,$FF,$FF,$00,$00 14 | DC.B $00,$00,$00,$FF,$FF,$FE,$FD,$FC 15 | DC.B $FB,$FA,$F8,$F7,$F5,$F3,$F1,$EF 16 | DC.B $ED,$EA,$E7,$E5,$E2,$DF,$DC,$D8 17 | DC.B $D5,$D1,$CE,$CA,$C6,$C2,$BE,$B9 18 | DC.B $B5,$B1,$AC,$A7,$A2,$9D,$98,$93 19 | DC.B $8E,$89,$84,$7E,$79,$73,$6D,$68 20 | DC.B $62,$5C,$56,$50,$4A,$44,$3E,$38 21 | DC.B $32,$2C,$26,$1F,$19,$13,$0D,$06 22 | DC.B $00,$FA,$F3,$ED,$E7,$E1,$DA,$D4 23 | DC.B $CE,$C8,$C2,$BC,$B6,$B0,$AA,$A4 24 | DC.B $9E,$98,$93,$8D,$87,$82,$7C,$77 25 | DC.B $72,$6D,$68,$63,$5E,$59,$54,$4F 26 | DC.B $4B,$47,$42,$3E,$3A,$36,$32,$2F 27 | DC.B $2B,$28,$24,$21,$1E,$1B,$19,$16 28 | DC.B $13,$11,$0F,$0D,$0B,$09,$08,$06 29 | DC.B $05,$04,$03,$02,$01,$01,$00,$00 30 | DC.B $00,$00,$00,$01,$01,$02,$03,$04 31 | DC.B $05,$06,$08,$09,$0B,$0D,$0F,$11 32 | DC.B $13,$16,$19,$1B,$1E,$21,$24,$28 33 | DC.B $2B,$2F,$32,$36,$3A,$3E,$42,$47 34 | DC.B $4B,$4F,$54,$59,$5E,$63,$68,$6D 35 | DC.B $72,$77,$7C,$82,$87,$8D,$93,$98 36 | DC.B $9E,$A4,$AA,$B0,$B6,$BC,$C2,$C8 37 | DC.B $CE,$D4,$DA,$E1,$E7,$ED,$F3,$FA 38 | SinTab.Hi 39 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 40 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 41 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 42 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 43 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 44 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 45 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 46 | DC.B $00,$00,$00,$00,$00,$00,$01,$01 47 | DC.B $01,$01,$01,$00,$00,$00,$00,$00 48 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 49 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 50 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 51 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 52 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 53 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 54 | DC.B $00,$00,$00,$00,$00,$00,$00,$00 55 | DC.B $00,$FF,$FF,$FF,$FF,$FF,$FF,$FF 56 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 57 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 58 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 59 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 60 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 61 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 62 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 63 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 64 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 65 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 66 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 67 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 68 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 69 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 70 | DC.B $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF 71 | -------------------------------------------------------------------------------- /demos/depacker/readme.md: -------------------------------------------------------------------------------- 1 | # Collection of depackers 2 | 3 | The example [picture](bmp/startrek_voyager.bmp) courtesy of Daniel Korican: 4 | https://brainbox78.artstation.com/ 5 | 6 | The number shown is the time to depack the `unpacked` sprite data (sprpck -u). 7 | 8 | * File sizes (in bytes) 9 | 10 | | Original | lz4 -12 | zx0 -c | Turbopacker | Exomizer | Exomizer RAW | upkr | upkr 255 | TSCrunch 11 | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | 12 | | 7381 | 3959 | 3074 | 3741 | 2927 | 2924 | 2778 | 2803 | 3534 13 | 14 | * Depacker sizes (in bytes) 15 | 16 | | unlz4 | unlz4 fast | zx0 | zx0 fast | tp | exo | exo RAW | upkr | upkr 255 | TSCrunch | TSC small 17 | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | 18 | | 131 | 178 | 167 | 232/314 | 108 | 270 | 308 | 352 | 303 | 169 | 146 | 19 | 20 | * Depack speed (in ms) (memory to memory) 21 | 22 | | unlz4 | unlz4 fast | zx0 | zx0 fast | tp | exo | exo RAW | upkr |upkr 255 | TSCrunch | TSC - small| memcpy | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: |:-: | 24 | | 156 | 84 | 262 | 209/166 | 107 | 303 | 280 |1629 | 1669 | 60 | 64 | 53 | 25 | 26 | ## unlz4/unlz4_fast 27 | 28 | Pack with `lz4 -l` and skip first 8 bytes. 29 | 30 | Packer: https://github.com/lz4/lz4 31 | 32 | Speed improvement if match/literal length <= 255. 33 | 34 | ## unzx0/unzx0_fast 35 | 36 | Pack with `zx0 -c` 37 | 38 | Packer: https://github.com/einar-saukas/ZX0 39 | 40 | Speed improvemnt in `zx0_fast` with inlining bit reading. 41 | 42 | ## untp 43 | 44 | Pack with: `tp +d` to pack without header. 45 | 46 | Packer: https://github.com/42Bastian/tp 47 | 48 | ## Exomizer 49 | 50 | Packer: https://bitbucket.org/magli143/exomizer/src/master/ 51 | 52 | ### sage's version 53 | 54 | Pack with `exomizer.exe level -P0 -f infile -o outfile.exo` 55 | 56 | *Note*: First two bytes are skipped (!?), so either add two dummy bytes before the packed data, or write those directly to the destination. 57 | 58 | Original depacker from: https://github.com/bspruck/exolynx 59 | 60 | ### RAW unpacker 61 | 62 | Pack with `exomizer raw -c -P-32 infile -o outfile.exoraw` 63 | 64 | See `unexo.var` for the `-P` or `-c` option. 65 | 66 | This is clean-room implementation based on unpack.c from the Exomizer repo. No byte skipping!! 67 | 68 | ## upkr 69 | 70 | Pack with standard options. 71 | 72 | Packer: https://github.com/exoticorn/upkr 73 | 74 | ## upkr_255 75 | 76 | Pack with --max-offset 255 --max-length 255 77 | 78 | ## TSCrunch 79 | 80 | Depacker for [TSCrunch](https://github.com/tonysavon/TSCrunch) 81 | 82 | Pack w/o any options. 83 | 84 | Small version has a minimal speed impact. -------------------------------------------------------------------------------- /includes/minihex.inc: -------------------------------------------------------------------------------- 1 | ;-*-asm-*- 2 | ;;; ---------------------------------------- 3 | ;;; minihex 4 | ;;; Non-sprite hex output 5 | ;;; 6 | ;;; Input: Y:A > 8 bit or A 7 | ;;; 8 | ;;; Set mh_screenBase to the screen to write to. 9 | ;;; There is no cursor, so just set base to move. 10 | ;;; 11 | ;;; Set mh_color (both nibbles!, e.g. $DD) 12 | 13 | minihex16:: 14 | pha 15 | tya 16 | jsr minihex8 17 | ;;-> bra minihex8a 18 | ;;->minihex12:: 19 | ;;-> pha 20 | ;;-> tya 21 | ;;-> jsr minihex4 22 | ;;->minihex8a 23 | pla 24 | minihex8:: 25 | pha 26 | lsr 27 | lsr 28 | lsr 29 | lsr 30 | jsr minihex4 31 | pla 32 | minihex4:: 33 | and #$f 34 | tay 35 | lda _l_0,y 36 | sta mh_low 37 | lda _h_0,y 38 | sta mh_high 39 | 40 | ldy #$ff 41 | .loop 42 | lda #0 43 | asl mh_low 44 | rol mh_high 45 | bcc .2 46 | lda #$f0 47 | .2 48 | asl mh_low 49 | rol mh_high 50 | bcc .3 51 | ora #$f 52 | .3 53 | and mh_color 54 | iny 55 | sta (mh_screenBase),y 56 | lda #0 57 | asl mh_low 58 | rol mh_high 59 | bcc .4 60 | lda #$f0 61 | .4 62 | and mh_color 63 | iny 64 | sta (mh_screenBase),y 65 | clc 66 | lda mh_screenBase 67 | adc #78 68 | sta mh_screenBase 69 | bcc .5 70 | inc mh_screenBase+1 71 | .5 72 | cpy #9 73 | bne .loop 74 | 75 | sec ; rewind ptr and next char 76 | lda mh_screenBase 77 | sbc #<(5*78-2) 78 | sta mh_screenBase 79 | lda mh_screenBase+1 80 | sbc #>(5*78-2) 81 | sta mh_screenBase+1 82 | rts 83 | 84 | _000 equ %000 85 | _100 equ %100 86 | _010 equ %010 87 | _110 equ %110 88 | _001 equ %001 89 | _101 equ %101 90 | _011 equ %011 91 | _111 equ %111 92 | 93 | MACRO charl 94 | _l_\0 95 | dc.b <((\1<<13)|(\2<<10)|(\3<<7)|(\4<<4)|(\5<<1)) 96 | ENDM 97 | 98 | MACRO charh 99 | _h_\0 100 | dc.b >((\1<<13)|(\2<<10)|(\3<<7)|(\4<<4)|(\5<<1)) 101 | ENDM 102 | 103 | charl 0,_010,_101,_101,_101,_010 104 | charl 1,_010,_110,_010,_010,_010 105 | charl 2,_010,_101,_001,_010,_111 106 | charl 3,_110,_001,_010,_001,_110 107 | charl 4,_100,_101,_111,_001,_001 108 | charl 5,_111,_100,_110,_001,_110 109 | charl 6,_011,_100,_110,_101,_010 110 | charl 7,_111,_001,_001,_010,_010 111 | charl 8,_010,_101,_010,_101,_010 112 | charl 9,_010,_101,_011,_001,_110 113 | charl A,_010,_101,_111,_101,_101 114 | charl B,_110,_101,_110,_101,_110 115 | charl C,_010,_101,_100,_101,_010 116 | charl D,_110,_101,_101,_101,_110 117 | charl E,_111,_100,_110,_100,_111 118 | charl F,_111,_100,_110,_100,_100 119 | 120 | charh 0,_010,_101,_101,_101,_010 121 | charh 1,_010,_110,_010,_010,_010 122 | charh 2,_010,_101,_001,_010,_111 123 | charh 3,_110,_001,_010,_001,_110 124 | charh 4,_100,_101,_111,_001,_001 125 | charh 5,_111,_100,_110,_001,_110 126 | charh 6,_011,_100,_110,_101,_010 127 | charh 7,_111,_001,_001,_010,_010 128 | charh 8,_010,_101,_010,_101,_010 129 | charh 9,_010,_101,_011,_001,_110 130 | charh A,_010,_101,_111,_101,_101 131 | charh B,_110,_101,_110,_101,_110 132 | charh C,_010,_101,_100,_101,_010 133 | charh D,_110,_101,_101,_101,_110 134 | charh E,_111,_100,_110,_100,_111 135 | charh F,_111,_100,_110,_100,_100 136 | -------------------------------------------------------------------------------- /demos/depacker/unzx0_fast.asm: -------------------------------------------------------------------------------- 1 | ;;; in: 2 | ;;; ZP 3 | ;;; src 4 | ;;; dst 5 | 6 | GETBIT_INLINE EQU 0 7 | 8 | MACRO GETBIT 9 | IF GETBIT_INLINE 10 | asl zx0_stor 11 | bne .\_1 12 | tax 13 | lda (src) 14 | sta zx0_stor 15 | txa 16 | rol zx0_stor 17 | inc src 18 | bne .\_1 19 | inc src+1 20 | .\_1 21 | ELSE 22 | jsr zx0_getbit 23 | ENDIF 24 | ENDM 25 | 26 | unzx0:: 27 | stz zx0_offset+1 28 | lda #1 29 | sta zx0_offset 30 | lda #$80 31 | sta zx0_stor 32 | .literal 33 | jsr zx0_elias 34 | .litcpy 35 | jsr zx0_getbyte 36 | sta (dst) 37 | inc dst 38 | bne .9 39 | inc dst+1 40 | .9 inx 41 | bne .litcpy 42 | iny 43 | bne .litcpy 44 | GETBIT 45 | bcc .old_offset 46 | .new_off 47 | jsr zx0_getoff 48 | lda zx0_value+1 49 | bne ._rts ; > 255 => EOF 50 | 51 | lsr zx0_value 52 | ror 53 | tax 54 | jsr zx0_getbyte 55 | lsr 56 | php ; save C 57 | sta zx0_value+1 58 | sec 59 | txa 60 | sbc zx0_value+1 61 | sta zx0_offset 62 | lda zx0_value 63 | adc #$ff 64 | sta zx0_offset+1 65 | plp 66 | 67 | ldx #$fe ; min count = 2 68 | ldy #$ff 69 | bcs .off 70 | 71 | lda #1 72 | stz zx0_value+1 73 | sta zx0_value 74 | jsr zx0_elias_pre 75 | dex ; matchlen + 1 76 | bne .off 77 | dey 78 | bra .off 79 | IF GETBIT_INLINE = 1 80 | ._rts: rts 81 | ENDIF 82 | .old_offset 83 | jsr zx0_elias 84 | .off 85 | sec 86 | lda dst 87 | sbc zx0_offset 88 | sta zx0_ptr 89 | lda dst+1 90 | sbc zx0_offset+1 91 | sta zx0_ptr+1 92 | sty zx0_value 93 | ldy #0 94 | .matchcpy 95 | lda (zx0_ptr),y 96 | sta (dst),y 97 | iny 98 | bne .3 99 | inc zx0_ptr+1 100 | inc dst+1 101 | .3 102 | inx 103 | bne .matchcpy 104 | inc zx0_value 105 | bne .matchcpy 106 | clc 107 | tya 108 | adc dst 109 | sta dst 110 | bcs .4 111 | GETBIT 112 | bcs .new_off 113 | jmp .literal 114 | .4 115 | inc dst+1 116 | GETBIT 117 | IF GETBIT_INLINE = 1 118 | bcs ._new_off 119 | jmp .literal 120 | ._new_off 121 | jmp .new_off 122 | ELSE 123 | bcs .new_off 124 | jmp .literal 125 | ENDIF 126 | 127 | IF GETBIT_INLINE = 0 128 | zx0_getbit 129 | lsr zx0_bc 130 | beq .1 131 | asl zx0_stor 132 | ._rts rts 133 | 134 | .1 135 | tax 136 | lda (src) 137 | asl 138 | sta zx0_stor 139 | 140 | txa 141 | dec zx0_bc 142 | 143 | inc src 144 | beq .91 145 | rts 146 | .91 147 | inc src+1 148 | rts 149 | ENDIF 150 | 151 | zx0_getbyte 152 | lda (src) 153 | inc src 154 | beq .9a 155 | rts 156 | .9a 157 | inc src+1 158 | .99 159 | rts 160 | 161 | zx0_getoff 162 | stz zx0_value+1 163 | lda #1 164 | .el 165 | GETBIT 166 | bcs .100 167 | GETBIT 168 | rol 169 | rol zx0_value+1 170 | bra .el 171 | .100 sta zx0_value 172 | rts 173 | 174 | zx0_elias:: 175 | stz zx0_value+1 176 | lda #1 177 | bra .el 178 | zx0_elias_pre 179 | GETBIT 180 | rol 181 | rol zx0_value+1 182 | .el 183 | GETBIT 184 | bcc zx0_elias_pre 185 | 186 | .done 187 | sta zx0_value 188 | eor #$ff 189 | adc #0 190 | tax 191 | lda #0 192 | sbc zx0_value+1 193 | tay 194 | rts 195 | -------------------------------------------------------------------------------- /includes/irq.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | ; created : 17.8.92 3 | ; 25.02.96 $FFF9 now %1100 instead of %1000 4 | ; 17.07.96 change IRQ-handle 5 | ; 28.01.97 special handling for Tx/Rx-IRQ 6 | ; 20.07.19 reworked code, remove CLD (not needed) 7 | 8 | InitIRQ:: 9 | php 10 | sei 11 | lda #$c 12 | sta $fff9 13 | lda #irq 16 | sta $ffff 17 | ldy #dummy_irq 21 | sta irq_vecs,x 22 | dex 23 | tya 24 | sta irq_vecs,x 25 | dex 26 | bpl .loop 27 | IFD BRKuser 28 | lda #>dummy_irq 29 | sta BRKvec+1 30 | sty BRKvec 31 | ENDIF 32 | plp 33 | rts 34 | IFD NEW_IRQ_HANDLER 35 | ;--------------- 36 | ;- Interrupt-Handler 37 | ;--------------- 38 | ; 39 | ; Timer 7 => 3+2+4+3+2+12 = 26 40 | ; Timer 6 => 3+2+4+2+3+12 = 28 41 | ; UART => 3+2+4+3+6 = 18 42 | ; pre = 19 43 | ; Timer 5 => 19+4*(2+2)+12 = 47 44 | ; Timer 3 => 19+3*(2+2)+(2+3)+12 = 48 45 | ; Timer 2 => 19+2*(2+2)+(2+3)+12 = 44 46 | ; Timer 1 => 19+1*(2+2)+(2+3)+12 = 40 47 | ; Timer 0 => 19+(2+3)+12 = 36 48 | 49 | ; Timer 0 => HBL 50 | ; Timer 2 => VBL 51 | 52 | irq:: 53 | pha ; 3 54 | lda #$10 ; 2 55 | bit $fd81 ; 4 56 | bne _4 ; 2,3 57 | bmi _7 ; 2,3 58 | bvs _6 ; 2,3 59 | lda $fd81 ; 4 60 | IFD BRKuser 61 | beq brk_handler 62 | ENDIF 63 | lsr ; 2 64 | bcs _0 ; 2,3 65 | lsr ; 2 66 | bcs _1 ; 2,3 67 | lsr ; 2 68 | bcs _2 ; 2,3 69 | lsr ; 2 70 | bcs _3 ; 2,3 71 | _5: 72 | lda #$20 ; 2 73 | sta $fd80 ; 4 74 | jmp (irq_vecs+5*2) ;6 75 | _4: 76 | jmp (irq_vecs+4*2) ; 6 77 | _3: 78 | lda #$08 79 | sta $fd80 80 | jmp (irq_vecs+3*2) 81 | _2: 82 | lda #$04 83 | sta $fd80 84 | jmp (irq_vecs+2*2) 85 | _1: 86 | lda #$2 87 | sta $fd80 88 | jmp (irq_vecs+1*2) 89 | _0: 90 | lda #$1 91 | sta $fd80 92 | jmp (irq_vecs+0*2) 93 | _6: 94 | lda #$40 95 | sta $fd80 96 | jmp (irq_vecs+6*2) 97 | _7: 98 | lda #$80 99 | sta $fd80 100 | jmp (irq_vecs+7*2) 101 | 102 | dummy_irq 103 | END_IRQ 104 | 105 | IFD BRKuser 106 | brk_handler: 107 | phx 108 | tsx 109 | lda $103,x ; p-register 110 | bit #$10 ; break ?? 111 | beq dummy_irq 112 | ;;-> and #$ef 113 | ;;-> sta $103,x 114 | plx 115 | pla 116 | jmp (BRKvec) 117 | ENDIF 118 | END 119 | ELSE 120 | ENDIF 121 | ;--------------- 122 | ;- Interrupt-Handler 123 | ;--------------- 124 | ; pre = 17 , post = 14 125 | ; Timer 0 => 17+4+2+2+14 = 39 126 | ; Timer 1 => 17+4+2+3+2+2+14 = 44 127 | ; Timer 2 => 17+4+2+2*(3+2)+2+14 = 49 128 | ; Timer 3 => 17+4+2+3*(3+2)+2+14 = 54 129 | ; UART => 22 130 | ; Timer 5 => 17+4+2+5*(3+2)+2+14 = 64 131 | ; Timer 6 => 17+4+2+6*(3+2)+2+14 = 69 132 | ; Timer 7 => 17+4+2+7*(3+2)+2+14 = 74 133 | irq:: 134 | phx ; 3 135 | pha ; 3 136 | ldx #0 ; 2 137 | lda $fd81 ; 4 138 | IFD BRKuser 139 | beq .break 140 | ENDIF 141 | bit #$10 ; SERIAL IRQ? ; 2 142 | beq .1 ; 2,3 143 | jmp (irq_vecs+8) ; 6 144 | 145 | .loop 146 | inx ; 2 147 | inx ; 2 148 | .1 149 | lsr ; 2 150 | bcc .loop ; 2,3 151 | 152 | lda mask,x ; 4 153 | sta $fd80 ; 4 154 | jmp (irq_vecs,x) ; 6 155 | IFD BRKuser 156 | .break 157 | tsx 158 | lda $103,x ; p-register 159 | bit #$10 ; break ?? 160 | beq dummy_irq 161 | ;;-> and #$ef 162 | ;;-> sta $103,x 163 | pla 164 | plx 165 | jmp (BRKvec) 166 | ENDIF 167 | mask 168 | dc.w $01,$02,$04,$08,$10,$20,$40,$80 169 | 170 | dummy_irq 171 | END_IRQ 172 | END 173 | -------------------------------------------------------------------------------- /demos/i2c_test.asm: -------------------------------------------------------------------------------- 1 | Baudrate equ 62500 2 | DEBUG set 1 3 | _1000HZ_TIMER set 7 4 | 5 | * Macros 6 | include 7 | 8 | include 9 | include 10 | include 11 | include 12 | include 13 | include 14 | include 15 | include 16 | include 17 | include 18 | * Variablen 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | include 27 | include 28 | include 29 | include 30 | include 31 | 32 | BEGIN_ZP 33 | counter ds 1 34 | address ds 1 35 | END_ZP 36 | 37 | BEGIN_MEM 38 | screen0 ds SCREEN.LEN 39 | irq_vektoren ds 16 40 | 41 | eeprom ds 128 42 | DefaultSaveGame ds 128 43 | END_MEM 44 | run LOMEM 45 | 46 | Start:: 47 | sei 48 | CLEAR_MEM 49 | CLEAR_ZP 50 | INITMIKEY 51 | INITSUZY 52 | SETRGB pal 53 | INITIRQ irq_vektoren 54 | INITKEY 55 | INITFONT LITTLEFNT,ROT,WEISS 56 | jsr Init1000Hz 57 | jsr InitComLynx 58 | cli 59 | SCRBASE screen0 60 | CLS #0 61 | SET_MINMAX 0,0,160,102 62 | LDAY hallo 63 | jsr print 64 | .loop00 65 | jsr ReadKey 66 | beq .cont0 67 | lda Button 68 | cmp #_FIREA 69 | bne .cont 70 | ldx #127 71 | .1 72 | stz eeprom,x 73 | dex 74 | bpl .1 75 | LDAY eeprom 76 | jsr WriteSaveGame 77 | bra .cont0 78 | .cont 79 | cmp #_FIREB 80 | bne .cont0 81 | jsr FillEEPROM 82 | 83 | .cont0 84 | stz CurrX 85 | lda #6 86 | sta CurrY 87 | lda counter 88 | inc counter 89 | jsr PrintHex 90 | stz CurrX 91 | lda #12 92 | sta CurrY 93 | stz address 94 | stz temp 95 | stz temp+1 96 | ldx #8 97 | .loop01 98 | phx 99 | ldx #8 100 | .loop02 101 | phx 102 | lda address 103 | jsr EE_Read 104 | 105 | lda I2Cword 106 | jsr PrintHex 107 | lda I2Cword+1 108 | jsr PrintHex 109 | 110 | inc address 111 | lda address 112 | cmp #$40 113 | beq .cont1 114 | clc 115 | lda temp 116 | adc I2Cword 117 | sta temp 118 | lda temp+1 119 | adc I2Cword+1 120 | sta temp+1 121 | .cont1 122 | inc CurrX 123 | inc CurrX 124 | plx 125 | dex 126 | bne .loop02 127 | stz CurrX 128 | clc 129 | lda CurrY 130 | adc #6 131 | sta CurrY 132 | plx 133 | dex 134 | bne .loop01 135 | LDAY checktxt 136 | jsr print 137 | lda temp 138 | jsr PrintHex 139 | lda temp+1 140 | jsr PrintHex 141 | jmp .loop00 142 | 143 | hallo 144 | dc.b "TEST-EERPOM : A - clear / B - fill",0 145 | checktxt 146 | dc.b "Checksum:",0 147 | 148 | FillEEPROM:: 149 | ldx #125 150 | .loop 151 | txa 152 | lsr 153 | ;--> lda #$ff 154 | sta eeprom,x 155 | lda counter 156 | dex 157 | ;--> lda #$ff 158 | sta eeprom,x 159 | dex 160 | bpl .loop 161 | LDAY eeprom 162 | jmp WriteSaveGame 163 | **************** 164 | PrintHex:: 165 | phx 166 | pha 167 | lsr 168 | lsr 169 | lsr 170 | lsr 171 | tax 172 | lda digits,x 173 | jsr PrintChar 174 | pla 175 | and #$f 176 | tax 177 | lda digits,x 178 | jsr PrintChar 179 | plx 180 | rts 181 | 182 | *************** 183 | digits db "0123456789ABCDEF" 184 | 185 | 186 | 187 | * INCLUDES 188 | include 189 | include 190 | include 191 | include 192 | include 193 | include 194 | include 195 | include 196 | include 197 | include 198 | 199 | pal STANDARD_PAL 200 | -------------------------------------------------------------------------------- /demos/minidemo/demo01.asm: -------------------------------------------------------------------------------- 1 | DOUBLEBUFFER set 1 ; 1 = double-buffering 2 | DEBUG set 1 ; if defined BLL loader is included 3 | Baudrate set 62500 4 | 5 | include 6 | include 7 | include 8 | include 9 | include 10 | ; 11 | ; essential variables 12 | ; 13 | include 14 | include 15 | 16 | ; 17 | ; local MACROs 18 | ; 19 | MACRO CLS 20 | lda #\0 21 | jsr cls 22 | ENDM 23 | ; 24 | ; zero-page 25 | ; 26 | BEGIN_ZP 27 | x ds 1 28 | y ds 1 29 | END_ZP 30 | ; 31 | ; main-memory variables 32 | ; 33 | BEGIN_MEM 34 | align 4 35 | screen0 ds SCREEN.LEN 36 | screen1 ds SCREEN.LEN 37 | 38 | END_MEM 39 | ; 40 | ; code 41 | ; 42 | 43 | run LOMEM 44 | 45 | Start:: 46 | START_UP 47 | CLEAR_MEM 48 | CLEAR_ZP +STACK 49 | 50 | INITMIKEY 51 | INITSUZY 52 | 53 | 54 | IF DOUBLEBUFFER 55 | SCRBASE screen0,screen1 56 | ELSE 57 | SCRBASE screen0 58 | ENDIF 59 | 60 | CLS 0 61 | IF DOUBLEBUFFER 62 | SWITCHBUF 63 | CLS 0 64 | ENDIF 65 | 66 | SETRGB pal ; set color 67 | lda #40 68 | sta x 69 | sta y 70 | 71 | ; 72 | ; main-loop 73 | ; 74 | .loop 75 | lda x 76 | sta sprite_x 77 | lda y 78 | sta sprite_y 79 | 80 | CLS 0 81 | LDAY spriteSCB 82 | jsr DrawSprite 83 | IF DOUBLEBUFFER 84 | SWITCHBUF 85 | ENDIF 86 | 87 | .0 READKEY ; see MIKEY.MAC 88 | lda Cursor 89 | beq .0 90 | 91 | bit #$c0 ; up | down 92 | _IFNE 93 | bit #$80 94 | _IFNE 95 | ldx y 96 | _IFNE 97 | dex 98 | _ENDIF 99 | stx y 100 | _ELSE 101 | ldx y 102 | cpx #101 103 | _IFNE 104 | inx 105 | _ENDIF 106 | stx y 107 | _ENDIF 108 | _ELSE 109 | bit #$20 110 | _IFNE 111 | ldx x 112 | _IFNE 113 | dex 114 | _ENDIF 115 | stx x 116 | _ELSE 117 | ldx x 118 | cpx #159 119 | _IFNE 120 | inx 121 | _ENDIF 122 | stx x 123 | _ENDIF 124 | _ENDIF 125 | 126 | jmp .loop 127 | 128 | 129 | spriteSCB dc.b $c0,$10,$00 130 | dc.w 0 ; no linking 131 | dc.w sprite_data 132 | sprite_x dc.w 0 133 | sprite_y dc.w 0 134 | dc.w $100 135 | dc.w $100 136 | dc.b $0F,$AC ; we use only 3 colors !! 137 | 138 | ; 139 | ; clear screen 140 | ; 141 | cls:: sta cls_color 142 | LDAY clsSCB 143 | jmp DrawSprite 144 | 145 | clsSCB dc.b $c0,$90,$00 146 | dc.w 0,cls_data 147 | dc.w 0,0 148 | dc.w 160*$100,102*$100 149 | cls_color dc.b 00 150 | 151 | cls_data dc.b 2,$10,0 152 | 153 | include 154 | 155 | pal STANDARD_PAL 156 | 157 | ; 158 | ; 4-quadrant-sprite => action-point is in the middle 159 | ; 160 | 161 | sprite_data ibytes "sprite.spr" 162 | -------------------------------------------------------------------------------- /demos/raw.asm: -------------------------------------------------------------------------------- 1 | *************** 2 | * RAW.ASM 3 | * simple body of a Lynx-program 4 | * 5 | * created : 24.04.96 6 | * changed : May 2020 7 | **************** 8 | 9 | 10 | Baudrate set 62500 ; define baudrate for serial.inc 11 | 12 | _1000HZ_TIMER set 7 ; timer# 13 | 14 | //->BRKuser set 1 ; if defined BRK #x support is enabled 15 | DEBUG set 1 ; if defined BLL loader is included 16 | 17 | 18 | include 19 | * macros 20 | include 21 | include 22 | include 23 | include 24 | 25 | include 26 | include 27 | include 28 | include 29 | * variables 30 | include 31 | include 32 | include 33 | include 34 | include 35 | include 36 | include 37 | include 38 | include 39 | * 40 | * local MACROs 41 | * 42 | MACRO CLS 43 | lda \0 44 | jsr cls 45 | ENDM 46 | 47 | * 48 | * vars only for this program 49 | * 50 | 51 | BEGIN_ZP 52 | counter ds 1 53 | Save1000Hz ds 2 54 | pcm_cnt ds 1 55 | END_ZP 56 | 57 | BEGIN_MEM 58 | ALIGN 4 59 | screen0 ds SCREEN.LEN 60 | irq_vektoren ds 16 61 | END_MEM 62 | run LOMEM ; code directly after variables 63 | 64 | Start:: ; Start-Label needed for reStart 65 | START_UP ; set's system to a known state 66 | CLEAR_MEM ; clear used memory(definded with BEGIN/END_MEM) 67 | CLEAR_ZP ; clear zero-page 68 | 69 | INITMIKEY 70 | INITSUZY 71 | 72 | INITIRQ irq_vektoren ; set up interrupt-handler 73 | INITKEY ,_FIREA|_FIREB ; repeat for A & B 74 | INITFONT SMALLFNT,RED,WHITE 75 | jsr Init1000Hz 76 | jsr InitComLynx 77 | INITBRK ; if we're using BRK #X, init handler 78 | 79 | SETIRQ 2,VBL ; set irq-vector and enable IRQ 80 | SETIRQ 0,HBL 81 | 82 | MOVEI StartPause,PausePtr ; load ptrs, MOVEI is in HELP.MAC 83 | MOVEI EndPause,PausePtr+2 84 | dec PauseEnable ; enable Pause 85 | 86 | cli ; allow interrupts 87 | SCRBASE screen0 ; set screen, single buffering 88 | CLS #0 ; clear screen with color #0 89 | SETRGB pal ; set palette 90 | 91 | SET_MINMAX 0,0,160,102 ; screen-dim. for FONT.INC 92 | 93 | stz $fd24 94 | stz $fd25 95 | stz $fd26 96 | stz $fd50 97 | 98 | .loop SET_XY 40,40 ; set FONT-cursor 99 | lda _1000Hz+1 100 | jsr PrintHex 101 | lda _1000Hz 102 | jsr PrintHex 103 | SET_XY 10,10 104 | jsr ReadKey ; test for key-press 105 | ; and do actions (PAUSE,FLIP,RESTART) 106 | lda CurrentButton 107 | jsr PrintHex 108 | bit #_FIREA|_FIREB 109 | beq .loop 110 | bit #_FIREA 111 | _IFNE 112 | inc counter 113 | _ELSE 114 | dec counter 115 | _ENDIF 116 | SET_XY 0,0 117 | lda counter 118 | jsr PrintHex 119 | bra .loop 120 | **************** 121 | 122 | VBL:: jsr Keyboard ; read buttons 123 | stz $fda0 124 | END_IRQ 125 | 126 | HBL:: inc $fda0 127 | 128 | ;; some PCM sound 129 | inc pcm_cnt 130 | lda pcm_cnt 131 | ldx #$20 132 | and #$20 133 | beq .x 134 | ldx #-$20 135 | .x 136 | stx $fd22 137 | END_IRQ 138 | **************** 139 | StartPause:: 140 | MOVE _1000Hz,Save1000Hz 141 | SET_XY 40,40 142 | PRINT "PAUSE",,1 143 | rts 144 | 145 | EndPause:: 146 | MOVE Save1000Hz,_1000Hz 147 | CLS #0 148 | rts 149 | **************** 150 | cls:: sta cls_color 151 | LDAY clsSCB 152 | jmp DrawSprite 153 | 154 | clsSCB dc.b $c0,$90,$00 155 | dc.w 0,cls_data 156 | dc.w 0,0 ; X,Y 157 | dc.w 160*$100,102*$100 ; size_x,size_y 158 | cls_color 159 | dc.b $00 160 | 161 | cls_data 162 | dc.b 2,$10,0 163 | 164 | 165 | **************** 166 | * INCLUDES 167 | include 168 | include 169 | include 170 | include 171 | include 172 | include 173 | include 174 | include 175 | include 176 | 177 | 178 | pal STANDARD_PAL 179 | -------------------------------------------------------------------------------- /demos/irq_test.asm: -------------------------------------------------------------------------------- 1 | **************** 2 | * IRQ_TEST.ASM 3 | * tiny example on IRQ-programming on the lynx 4 | * 5 | * created : somewhat in the nineties ;) 6 | * 7 | * modified : 8 | * 06.05.96 BS translation to English 9 | * 22.06.98 BS slight modifications 10 | * 11.06.20 BS switch for new IRQ handler added 11 | 12 | NEW_IRQ_HANDLER EQU 1 13 | 14 | include 15 | * macros 16 | include 17 | include 18 | include 19 | include 20 | include 21 | * vardefs 22 | include 23 | include 24 | include 25 | include 26 | 27 | **************** 28 | 29 | BEGIN_ZP 30 | irq_vectors ds 16 31 | _10 ds 2 32 | sema ds 1 33 | END_ZP 34 | BEGIN_MEM 35 | screem DS SCREEN.LEN 36 | END_MEM 37 | run LOMEM 38 | START_UP 39 | CLEAR_ZP 40 | ldx #$ff 41 | txs 42 | cld 43 | sei 44 | INITSUZY 45 | INITMIKEY 46 | INITIRQ irq_vectors 47 | FRAMERATE 60 48 | * set IRQ-vectors and enable IRQs 49 | SETIRQ 0,HBL 50 | SETIRQ 2,VBL 51 | SETIRQ 3,_1000Hz 52 | * init 1000Hz-Counter 53 | lda #249 54 | sta $fd0c 55 | lda #%11011010 ; divider 4 56 | sta $fd0d 57 | * 58 | 59 | cli 60 | stz _10 61 | stz _10+1 62 | .loop lda $fd0a 63 | bne .loop 64 | .wait 65 | READKEY 66 | lda Cursor 67 | beq .wait 68 | bit #$80 69 | beq .no_up 70 | sec 71 | lda _10 72 | sbc #1 73 | sta _10 74 | lda _10+1 75 | sbc #0 76 | sta _10+1 77 | bcs .loop 78 | stz _10 79 | stz _10+1 80 | bra .loop 81 | .no_up bit #$40 82 | beq .loop 83 | clc 84 | lda _10 85 | adc #1 86 | sta _10 87 | lda _10+1 88 | adc #0 89 | sta _10+1 90 | cmp #$10 91 | blt .loop 92 | lda #$ff 93 | sta _10 94 | lda #$f 95 | sta _10+1 96 | bra .loop 97 | **************** 98 | * interrupt routines 99 | **************** 100 | _1000Hz:: 101 | IFD NEW_IRQ_HANDLER 102 | phx 103 | ENDIF 104 | lda #$ff 105 | tsb sema 106 | bne .exit 107 | cli 108 | ldx #10 109 | .l nop 110 | nop 111 | nop 112 | nop 113 | nop 114 | dex 115 | bpl .l 116 | stz sema 117 | .exit 118 | IFD NEW_IRQ_HANDLER 119 | plx 120 | ENDIF 121 | END_IRQ 122 | 123 | HBL: 124 | inc $fdbf 125 | inc $fdaf 126 | 127 | selfHBL lda #0 128 | beq .sub 129 | inc $fda0 130 | lda $fda0 131 | cmp #$f 132 | bne .ok 133 | stz selfHBL+1 134 | .ok END_IRQ 135 | 136 | .sub dec $fda0 137 | bne .ok 138 | dec selfHBL+1 139 | END_IRQ 140 | 141 | VBL:: lda _10 142 | sta $fdb0 143 | stz $fda0 144 | 145 | stz $fdbf 146 | stz $fdaf 147 | END_IRQ 148 | 149 | include 150 | -------------------------------------------------------------------------------- /includes/eeprom8.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | **************** 3 | * EEPROM-routines 4 | * for 93C46A (1024bit => 128 8-bit words) 5 | * 6 | * created : 11.05.95 7 | * last modified : 8 | * 9 | * 16.02.96 leaner (thanks to Harry) 10 | * 12.03.96 test for busy after write and erase (well, Harry ;)) ) 11 | * 11.01.99 new EEPROMs need DO to be set to 0 command write! 12 | * 22.04.04 Version for 8 bit organized EEPROMS 13 | * 14 | * 15 | * 16 | * (c) 1995 Bastian Schick 17 | * CS = A7 (18) 18 | * CLK = A1 (11) 19 | * DI/DO = AUDIN (32) 20 | * 21 | *And now how to contact the EEPROM : 22 | * 23 | *CARD 24 | *PORT ----\/---- 93C46(SMD too) 25 | *(18) A7 --------| CS |- +5V 26 | *(11) A1 --------| CLK |- NC 27 | * +---| DI |- NC 28 | *(32) AUDIN ----+---| DO |- GND 29 | * ---------- 30 | * 31 | **************** 32 | 33 | * ------------------- 34 | * EEPROM command list 35 | * ------------------- 36 | EE_C_WRITE EQU $40 37 | EE_C_READ EQU $80 38 | EE_C_ERASE EQU $C0 39 | EE_C_EWEN EQU $60 40 | EE_C_EWDS EQU $00 41 | 42 | 43 | MACRO EE_TOGGLE_CLK 44 | stz $fcb2 45 | stz $fcb2 46 | ENDM 47 | 48 | MACRO EE_SET_CS_HIGH ; CS = 1 49 | ldx #63 50 | .\ee1 stz $fcb2 51 | stz $fcb2 52 | dex 53 | bpl .\ee1 54 | ENDM 55 | 56 | MACRO EE_SET_CS_LOW ; CS = 0 and CLK = 0 57 | ldx #3 58 | stx $fd87 59 | dex 60 | stx $fd87 61 | ENDM 62 | 63 | **************** 64 | * read 16bit Wort from address A 65 | **************** 66 | EE_Read:: 67 | pha ; save address 68 | clc 69 | jsr EE_ReadHigh 70 | 71 | lda I2Cword 72 | sta I2Cword+1 73 | 74 | pla 75 | sec 76 | EE_ReadHigh: 77 | and #$3f 78 | rol ; odd address 79 | sec 80 | jsr EE_Send10Bit 81 | **************** 82 | * reads EEPROM-word to I2Cword 83 | * A,Y destroyed 84 | **************** 85 | EE_Read8Bit:: 86 | lda #$a 87 | sta $fd8A ; set AUDIN to Input 88 | 89 | clc 90 | stz I2Cword 91 | ldy #7 92 | .loop 93 | EE_TOGGLE_CLK ; CLK = 1 94 | EE_TOGGLE_CLK ; CLK = 0 95 | lda $fd8b 96 | and #$10 ; mask bit 97 | adc #$f0 ; C=1 if A=$10 98 | rol I2Cword 99 | dey 100 | bpl .loop 101 | 102 | ldx #$1a 103 | stx $fd8a ; set AUDIN for output 104 | 105 | EE_SET_CS_LOW 106 | 107 | rts 108 | IF 0 109 | **************** 110 | * clear word at address A 111 | **************** 112 | EE_Erase:: 113 | pha 114 | lda #EE_C_EWEN ; EWEN 115 | jsr EE_Send10Bit 116 | pla 117 | and #$3f 118 | ora #EE_C_ERASE ; clear cell A 119 | jsr EE_Send10Bit 120 | bra EE_wait 121 | ENDIF 122 | **************** 123 | * write word at address A 124 | **************** 125 | 126 | EE_Write8: 127 | and #$3f 128 | rol 129 | ora #$80 130 | clc 131 | jsr EE_Send10Bit 132 | jsr EE_Send8Bit 133 | 134 | EE_wait 135 | EE_SET_CS_HIGH 136 | lda #$0A 137 | sta $fd8a ; AUDIN to input 138 | lda #$10 139 | .wait bit $fd8b ; 'til ready :D0-read is /D0-written 140 | beq .wait 141 | lda #$1a ; AUDIN to output 142 | sta $fd8a 143 | rts 144 | 145 | EE_Write:: 146 | pha ; save address 147 | clc 148 | lda #EE_C_EWEN 149 | jsr EE_Send10Bit ; enable write/erase 150 | pla 151 | pha 152 | sec 153 | jsr EE_Write8 154 | lda I2Cword+1 155 | sta I2Cword 156 | clc 157 | pla 158 | jsr EE_Write8 159 | clc 160 | lda #EE_C_EWDS ; disable write/erase 161 | **************** 162 | * send A via I2C 163 | * A,Y destroyed 164 | **************** 165 | EE_Send10Bit:: 166 | ror 167 | ror 168 | ror 169 | ror ; bit 8 at pos. 4 170 | php 171 | 172 | EE_SET_CS_LOW ; CLK = 0 / CS = 0 173 | EE_SET_CS_HIGH 174 | 175 | ldx #$1b ; start-bit 176 | stx $fd8b 177 | EE_TOGGLE_CLK ; CLK = 1 178 | EE_TOGGLE_CLK ; CLK = 0 179 | 180 | plp 181 | ldy #8 182 | 183 | ;; send y+1 bits 184 | EE_send: 185 | .loop 186 | tax 187 | and #$10 188 | ora #$b 189 | sta $fd8b 190 | EE_TOGGLE_CLK ; CLK = 1 191 | EE_TOGGLE_CLK ; CLK = 0 192 | txa 193 | rol 194 | dey 195 | bpl .loop 196 | 197 | lda #$b 198 | sta $fd8b 199 | 200 | rts 201 | **************** 202 | * send I2Cword to EEPROM 203 | * A,Y detroyed 204 | **************** 205 | EE_Send8Bit:: 206 | lda I2Cword 207 | ror 208 | ror 209 | ror 210 | 211 | ldy #7 212 | jsr EE_send 213 | 214 | EE_SET_CS_LOW 215 | 216 | rts 217 | -------------------------------------------------------------------------------- /demos/overlay/overlay.asm: -------------------------------------------------------------------------------- 1 | ;;; Little overlay/file loading demo 2 | ;;; Inspired by Laoo ;-) 3 | ;;; 4 | 5 | ;; configuration 6 | BlockSize equ 1024 7 | LoadDirUser equ 1 ; use LoadDir 8 | LocalDirUser equ 1 ; use directory in RAM not from ROM 9 | 10 | IRQ_SWITCHBUF_USR set 1 11 | 12 | IFND LNX 13 | LNX set 1 14 | ENDIF 15 | include 16 | * macros 17 | include 18 | include 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | include 27 | * variables 28 | include 29 | include 30 | include 31 | include 32 | include 33 | include 34 | 35 | * 36 | * local MACROs 37 | * 38 | MACRO CLS 39 | lda \0 40 | jsr cls 41 | ENDM 42 | 43 | * 44 | * vars only for this program 45 | * 46 | 47 | BEGIN_ZP 48 | irq_vektoren ds 16 49 | overlay ds 1 50 | END_ZP 51 | 52 | screen0 equ $fff0-SCREEN.LEN 53 | screen1 equ screen0-SCREEN.LEN 54 | 55 | 56 | CART_HEADER "Overlay Test","42Bastian",0,0 57 | 58 | run $1ff 59 | dc.b 1+((End-Start)>>8) 60 | 61 | Start:: ; Start-Label needed for reStart 62 | jmp init 63 | main: 64 | INITFONT SMALLFNT,0,15 65 | main_loop: 66 | CLS #2 67 | SET_XY 10,10 ; set FONT-cursor 68 | LDAY info1 69 | jsr print 70 | lda overlay 71 | bmi no_overlay 72 | jsr overlay_start 73 | no_overlay 74 | SWITCHBUF 75 | .wait lda $fcb0 76 | beq .wait 77 | .wait1 ldx $fcb0 78 | bne .wait1 79 | 80 | bit #JOY_A 81 | beq .no_A 82 | ldx #0 83 | bra .ok 84 | .no_A 85 | bit #JOY_B 86 | beq .wait 87 | ldx #1 88 | .ok 89 | jsr LoadOverlay 90 | jmp main_loop 91 | 92 | info1: dc.b "Hello Overlay:",0 93 | 94 | 95 | LoadOverlay:: 96 | stx overlay 97 | txa 98 | LOADFILE 99 | rts 100 | 101 | VBL:: 102 | phy 103 | _IFMI SWITCHFlag 104 | stz SWITCHFlag 105 | ldx ScreenBase 106 | ldy ScreenBase+1 107 | lda ScreenBase2 108 | sta ScreenBase 109 | sta VIDBAS 110 | lda ScreenBase2+1 111 | sta ScreenBase+1 112 | sta VIDBAS+1 113 | stx ScreenBase2 114 | sty ScreenBase2+1 115 | stx $fd94 116 | sty $fd95 117 | _ENDIF 118 | 119 | ply 120 | END_IRQ 121 | 122 | cls:: sta cls_color 123 | LDAY clsSCB 124 | jmp DrawSprite 125 | 126 | clsSCB dc.b $c0,$90,$00 127 | dc.w 0,cls_data 128 | dc.w 0,0 ; X,Y 129 | cls_size: 130 | dc.w 160*$100 131 | dc.w 102*$100 ; size_x,size_y 132 | cls_color 133 | dc.b $00 134 | 135 | cls_data 136 | dc.b 2,$10,0 137 | 138 | include 139 | include 140 | include 141 | include 142 | include 143 | include 144 | 145 | FileDirectory: 146 | OVERLAY_DIR_ENTRY overlay1 147 | OVERLAY_DIR_ENTRY overlay2 148 | 149 | ;; Code from here is no longer needed after startup 150 | init: 151 | START_UP ; set's system to a known state 152 | CLEAR_ZP ; clear zero-page 153 | 154 | INITMIKEY 155 | INITSUZY 156 | INITIRQ irq_vektoren ; set up interrupt-handler 157 | SETRGB pal ; set palette 158 | 159 | FRAMERATE 60 160 | 161 | SETIRQ 2,VBL 162 | SCRBASE screen0,screen1 163 | MOVE ScreenBase,VIDBAS 164 | SET_MINMAX 0,0,159,101 ; screen-dim. for FONT.INC 165 | 166 | dec overlay ; flag: no overlay loaded yet 167 | cli 168 | jmp main 169 | 170 | pal STANDARD_PAL 171 | ;; End of main program 172 | End:: 173 | 174 | ;; move ROM PC behind main program 175 | ROM_PC set ROM_PC+(End-Start+1) 176 | 177 | ;; init code is no longer needed 178 | overlay_start equ init 179 | 180 | echo "Overlay: %Hoverlay_start" 181 | IF 0 182 | ROM_BLOCK_ALIGN $42 183 | ENDIF 184 | OVERLAY_BEGIN overlay1, overlay_start 185 | LDAY info_ovl1 186 | jsr print 187 | rts 188 | info_ovl1: 189 | dc.b "Overlay 1",0 190 | ds 2000 ; dummy stuff 191 | OVERLAY_END overlay1 192 | 193 | OVERLAY_BEGIN overlay2, overlay_start 194 | LDAY info_ovl2 195 | jsr print 196 | rts 197 | info_ovl2: 198 | dc.b "Overlay 2",0 199 | OVERLAY_END overlay2 200 | 201 | echo "%H ROM_overlay1 %dsize_overlay1" 202 | echo "%H ROM_overlay2 %dsize_overlay2" 203 | -------------------------------------------------------------------------------- /demos/depacker/unupkr.asm: -------------------------------------------------------------------------------- 1 | ;;; in: 2 | ;;; ZP 3 | ;;; src 4 | ;;; dst 5 | 6 | 7 | unupkr:: 8 | MOVEI (upkr_probs_array+$100), upkr_probs 9 | lda #$80 10 | ldy #255+1+2*32+2*32-256-1 11 | .init1 sta (upkr_probs),y 12 | dey 13 | bpl .init1 14 | dec upkr_probs+1 15 | iny 16 | .init2 sta (upkr_probs),y 17 | iny 18 | bne .init2 19 | 20 | HANDY_BRKPT 21 | 22 | stz upkr_offset 23 | stz upkr_offset+1 24 | stz upkr_state 25 | stz upkr_state+1 26 | bra .start 27 | .literal: 28 | sty upkr_value 29 | jsr upkr_getbit 30 | lda upkr_value 31 | rol 32 | tay 33 | bcc .literal 34 | sta (dst) 35 | inc dst 36 | bne .1 37 | inc dst+1 38 | .1 39 | .start 40 | stz upkr_pwm 41 | .loop 42 | ldy #0 43 | jsr upkr_getbit 44 | bcc .literal ; y=1 ! 45 | inc upkr_probs+1 ; probs[256...] 46 | bit upkr_pwm 47 | bmi .newoff 48 | dey 49 | jsr upkr_getbit ; index = 256 50 | bcc .oldoff 51 | .newoff 52 | iny 53 | jsr upkr_getlen ; y = 1 => index = 257 54 | inx 55 | beq .checkeof 56 | .noeof 57 | stx upkr_offset 58 | sta upkr_offset+1 59 | .oldoff 60 | ldy #257+64-256 61 | jsr upkr_getlen 62 | dec upkr_pwm 63 | dec upkr_probs+1 ; probs[0...255] 64 | 65 | clc 66 | lda dst 67 | adc upkr_offset 68 | sta upkr_ptr 69 | lda dst+1 70 | adc upkr_offset+1 71 | sta upkr_ptr+1 72 | ldy #0 73 | .cpymatch 74 | lda (upkr_ptr),y 75 | sta (dst),y 76 | iny 77 | bne .2 78 | inc upkr_ptr+1 79 | inc dst+1 80 | .2 81 | inx 82 | bne .cpymatch 83 | inc upkr_value+1 84 | bne .cpymatch 85 | clc 86 | tya 87 | adc dst 88 | sta dst 89 | bcc .loop 90 | inc dst+1 91 | bra .loop 92 | .checkeof 93 | inc 94 | bne .noeof 95 | rts 96 | 97 | IF 1 98 | upkr_getlen: 99 | lda #upkr_value 100 | sta .smc+1 101 | sta .smc1+1 102 | stz upkr_value 103 | stz upkr_value+1 104 | .gl0 105 | lda #1 106 | .gl 107 | pha 108 | jsr upkr_getbit 109 | bcc .done 110 | jsr upkr_getbit 111 | pla 112 | bcc .4 113 | .smc 114 | tsb upkr_value 115 | .4 116 | asl 117 | bcc .gl 118 | inc .smc+1 119 | inc .smc1+1 120 | bra .gl0 121 | .done 122 | pla 123 | .smc1 124 | tsb upkr_value 125 | sec 126 | lda #0 127 | sbc upkr_value 128 | tax 129 | lda #0 130 | sbc upkr_value+1 131 | sta upkr_value+1 132 | rts 133 | ENDIF 134 | 135 | ;; get next bit 136 | .newbyte: 137 | sta upkr_state+2 138 | lda upkr_state 139 | sta upkr_state+1 140 | lda (src) 141 | sta upkr_state 142 | inc src 143 | bne upkr_getbit 144 | inc src+1 145 | upkr_getbit: 146 | lda upkr_state+2 147 | bne .3 148 | lda upkr_state+1 149 | bit #$F0 150 | beq .newbyte ; < $1000 => next byte 151 | .3 152 | lda (upkr_probs),y 153 | sta MATHD ; prepare: *prob 154 | ldx #0 155 | cmp upkr_state 156 | bcc .zero 157 | bne .one 158 | clc 159 | .zero 160 | lda upkr_state+1 161 | adc #1 162 | sta MATHB 163 | txa 164 | adc upkr_state+2 165 | sta MATHA 166 | 167 | sec 168 | lda upkr_state 169 | 170 | WAITSUZY 171 | 172 | sbc MATHH 173 | sta upkr_state 174 | lda upkr_state+1 175 | sbc MATHG 176 | sta upkr_state+1 177 | lda upkr_state+2 178 | sbc MATHF 179 | sta upkr_state+2 180 | 181 | lda (upkr_probs),y 182 | lsr 183 | lsr 184 | lsr 185 | lsr 186 | adc #0 187 | eor #$ff 188 | sec 189 | adc (upkr_probs),y 190 | clc 191 | .exit 192 | sta (upkr_probs),y 193 | iny 194 | rts 195 | .one: 196 | lda upkr_state+1 197 | sta MATHB 198 | lda upkr_state+2 199 | sta MATHA 200 | 201 | clc 202 | lda upkr_state 203 | 204 | WAITSUZY 205 | 206 | adc MATHH 207 | sta upkr_state 208 | txa 209 | adc MATHG 210 | sta upkr_state+1 211 | txa 212 | adc MATHF 213 | sta upkr_state+2 214 | 215 | lda (upkr_probs),y 216 | eor #$ff 217 | inc 218 | lsr 219 | lsr 220 | lsr 221 | lsr 222 | adc (upkr_probs),y 223 | sec 224 | bra .exit 225 | 226 | IF 0 227 | ;; Shorter but longer execution time 228 | upkr_getlen: 229 | lda #$ff 230 | sta upkr_value 231 | sta upkr_value+1 232 | clc 233 | bra .into 234 | .gl 235 | jsr upkr_getbit 236 | .into 237 | ror upkr_value+1 238 | ror upkr_value 239 | jsr upkr_getbit 240 | bcs .gl 241 | 242 | sec 243 | dc.b $a9 244 | .gl2 clc 245 | ror upkr_value+1 246 | ror upkr_value 247 | bcs .gl2 248 | 249 | sec 250 | lda #0 251 | sbc upkr_value 252 | tax 253 | lda #0 254 | sbc upkr_value+1 255 | sta upkr_value+1 256 | rts 257 | ENDIF 258 | -------------------------------------------------------------------------------- /SendCart.py/SendCart.py: -------------------------------------------------------------------------------- 1 | # 2 | # Send BLL .o file to the Lynx 3 | # 4 | import serial 5 | import sys 6 | from time import sleep 7 | from os.path import exists,dirname 8 | from struct import * 9 | 10 | class LNXheader: 11 | def __init__(self,ps = 1024, name = 'empty'): 12 | self.magic = b'LYNX' 13 | self.page_size_bank0 = ps 14 | self.page_size_bank1 = 0 15 | self.version = 1 16 | self.cartname = name 17 | self.manufname = b'BS42' 18 | self.rotation = 0 19 | 20 | def fromFile(self,data): 21 | (self.magic, 22 | self.page_size_bank0, 23 | self.page_size_bank1, 24 | self.version, 25 | self.cartname, 26 | self.manufname, 27 | self.rotation, 28 | b,h0,h1) = unpack("<4s hhh 32s 16s b bhh",data) 29 | 30 | def bytes(self) -> bytearray: 31 | return pack("<4s hhh 32s 16s b bhh", 32 | self.magic, 33 | self.page_size_bank0, 34 | self.page_size_bank1, 35 | 1, 36 | self.cartname.encode(), 37 | self.manufname, 38 | self.rotation, 39 | 0,0,0) 40 | 41 | verbose=True 42 | blocksize=1024 43 | 44 | baud=115200*8 45 | port='/dev/tty.usbmodem165120401' 46 | imhd=bytearray(10) 47 | image=bytearray(512*1024) 48 | lnxhead=bytearray(64); 49 | filename="" 50 | 51 | def sendByte(byte: int): 52 | tmo = 10 53 | if isinstance(byte,int): 54 | _b = bytearray([byte]) 55 | else: 56 | _b = byte 57 | 58 | ser.write(_b) 59 | 60 | def getByte() -> int: 61 | byte = ser.read(1) 62 | if len(byte) == 1: 63 | return byte[0] 64 | else: 65 | return -1 66 | 67 | def loadImage(filename, verbose): 68 | global image 69 | global lnxhead 70 | image.clear() 71 | # lnxhead=LNXheader() 72 | try: 73 | fd = open(filename,'rb') 74 | except: 75 | print("Error opening ",filename) 76 | exit(1) 77 | try: 78 | lnxhead = bytearray(fd.read(64)) 79 | except: 80 | print("Error reading header of",filename) 81 | exit(1) 82 | 83 | s = (lnxhead[4]+lnxhead[5]*256) 84 | 85 | try: 86 | s *= 256 87 | image = bytearray(fd.read()) 88 | l = len(image) 89 | if ( l != s ): 90 | if verbose : 91 | print("Size only ",len(image)) 92 | for i in range(0,s-l): 93 | image.append(0xff) 94 | except: 95 | print("Error reading ",filename) 96 | exit(1) 97 | 98 | fd.close 99 | 100 | ################################## 101 | 102 | n = len(sys.argv) 103 | 104 | if n == 1: 105 | print("SendCard -h") 106 | print("SendCard [-p ] [-b baud] file") 107 | exit(1) 108 | 109 | p=1 110 | while p < n-1: 111 | if sys.argv[p] == '-h' or sys.argv[p] == '--help': 112 | print("SendCard for peekb's EPROMEmu\n" 113 | "SendCard.py [-b|--baud ] filename") 114 | exit(1) 115 | 116 | if sys.argv[p] == '-b' or sys.argv[p] == '--baud': 117 | baud = sys.argv[p+1] 118 | p += 2 119 | continue 120 | 121 | if sys.argv[p] == '-p' or sys.argv[p] == '--port': 122 | port = sys.argv[p+1] 123 | p += 2 124 | continue 125 | 126 | if sys.argv[p] == '-q': 127 | verbose=False 128 | p += 1 129 | continue 130 | 131 | if sys.argv[p] == '-s': 132 | blocksize = int(sys.argv[p+1]) 133 | p += 2 134 | if blocksize != 512 and blocksize != 1024 and blocksize != 2048: 135 | print("Wrong blocksize, must be 512,1024 or 2048") 136 | exit(1) 137 | continue 138 | 139 | print("Wrong argument:",sys.argv[p]) 140 | exit(1) 141 | 142 | filename = sys.argv[p] 143 | 144 | try: 145 | ser = serial.Serial(port,baud,parity='E',timeout=.1) 146 | except: 147 | print("Could not open: ",port) 148 | exit(1) 149 | 150 | 151 | loadImage(filename, verbose) 152 | 153 | if verbose : 154 | print("Port:", port,"\nBaud:",baud) 155 | print("Sending: ",filename) 156 | print("Size: ",len(image)) 157 | 158 | sendByte(b'c') 159 | sendByte(b'l') 160 | ser.write(lnxhead) 161 | ser.flush() 162 | ser.write(image) 163 | ser.flush() 164 | ser.close() 165 | -------------------------------------------------------------------------------- /demos/kingtut/show_tut.asm: -------------------------------------------------------------------------------- 1 | Baudrate set 62500 ; define baudrate for serial.inc 2 | DEBUG set 1 ; if defined BLL loader is included 3 | BRKuser set 1 ; if defined BRK #x support is enabled 4 | 5 | include ; get hardware-names 6 | * Macros 7 | include 8 | include 9 | include 10 | include 11 | include 12 | include 13 | include 14 | include 15 | include 16 | * Variablen 17 | include 18 | include 19 | include 20 | include 21 | include 22 | include 23 | include 24 | include 25 | include 26 | 27 | * 28 | * vars only for this program 29 | * 30 | 31 | BEGIN_ZP 32 | 33 | END_ZP 34 | 35 | BEGIN_MEM 36 | ALIGN 4 37 | screen0 ds SCREEN.LEN 38 | irq_vektoren ds 16 39 | END_MEM 40 | run LOMEM ; code directly after variables 41 | 42 | Start:: ; Start-Label needed for reStart 43 | START_UP ; set's system to a known state 44 | CLEAR_MEM ; clear used memory (definded with BEGIN/END_MEM) 45 | CLEAR_ZP ; clear zero-page 46 | 47 | INITMIKEY 48 | INITSUZY 49 | 50 | INITIRQ irq_vektoren ; set up interrupt-handler 51 | INITKEY ,_FIREA|_FIREB ; repeat for A & B 52 | INITFONT SMALLFNT,RED,WHITE 53 | jsr InitComLynx 54 | INITBRK ; if we're using BRK #X, init handler 55 | 56 | SETIRQ 2,VBL ; set irq-vector and enable IRQ 57 | ;> SETIRQ 0,HBL 58 | 59 | MOVEI StartPause,PausePtr ; load ptrs, MOVEI is in HELP.MAC 60 | MOVEI EndPause,PausePtr+2 61 | dec PauseEnable ; enable Pause 62 | 63 | cli ; allow interrupts 64 | SCRBASE screen0 ; set screen, single buffering 65 | CLS #0 ; clear screen with color #0 66 | SETRGB pal ; set palette 67 | 68 | LDAY kingtutSCB 69 | jsr DrawSprite 70 | .loop 71 | bra .loop 72 | **************** 73 | 74 | VBL:: jsr Keyboard ; read buttons 75 | stz $fda0 76 | END_IRQ 77 | 78 | HBL:: inc $fda0 79 | END_IRQ 80 | **************** 81 | StartPause:: SET_XY 40,40 82 | PRINT "PAUSE",,1 83 | rts 84 | 85 | EndPause:: CLS #0 86 | rts 87 | **************** 88 | cls:: sta cls_color 89 | LDAY clsSCB 90 | jmp DrawSprite 91 | 92 | clsSCB dc.b $c0,$90,$00 93 | dc.w 0,cls_data 94 | dc.w 0,0 ; X,Y 95 | dc.w 160*$100,102*$100 ; size_x,size_y 96 | cls_color dc.b $00 97 | 98 | cls_data dc.b 2,$10,0 99 | 100 | 101 | **************** 102 | * INCLUDES 103 | 104 | include 105 | include 106 | include 107 | include 108 | include 109 | include 110 | include 111 | include 112 | 113 | kingtutSCB db $c1,$10,0 114 | dw 0 115 | dw kingtut 116 | dw 35,5 117 | dw $100,$100 118 | db $01,$23,$45,$67 119 | db $89,$ab,$cd,$ef 120 | 121 | path 122 | pal ibytes "kingtut.pal" 123 | kingtut ibytes "kingtut.pic" 124 | -------------------------------------------------------------------------------- /includes/draw.inc: -------------------------------------------------------------------------------- 1 | * -*-asm-*- 2 | ******************* 3 | * PLOT X,Y,A 4 | ******************* 5 | Plot:: stx .PLOTx 6 | sty .PLOTy 7 | sta .PLOTcolor 8 | MOVEI .PLOTSCB,$fc10 9 | jmp draw_DrawSprite 10 | 11 | .PLOTSCB 12 | db $c0,$90,00 13 | dw 0 14 | dw .PLOTdata 15 | .PLOTx dw 0 16 | .PLOTy dw 0 17 | dw $100,$100 18 | .PLOTcolor 19 | db $00 20 | .PLOTdata 21 | db 2,$10,0 22 | ******************* 23 | DrawLine:: 24 | sta .dl_scb_color 25 | 26 | sec 27 | lda x2 28 | sbc x1 29 | lda x2+1 30 | sbc x1+1 31 | _IFMI 32 | SWAP x2,x1 33 | SWAP y2,y1 34 | _ENDIF 35 | 36 | MOVE x1,.dl_scb_x 37 | MOVE y1,.dl_scb_y 38 | 39 | ldx #%11000000 40 | sec 41 | lda y2 42 | sbc y1 43 | tay 44 | lda y2+1 45 | sbc y1+1 46 | _IFMI 47 | tya 48 | eor #$ff 49 | inc 50 | tay 51 | ldx #%11010000 52 | _ENDIF 53 | 54 | stx .dl_scb 55 | iny 56 | sty .dl_scb_ysize+1 57 | sty MATHE_B 58 | //-> stz MATHE_B+1 59 | 60 | stz MATHE_A 61 | stz MATHE_A+2 62 | sec 63 | lda x2 64 | sbc x1 65 | inc 66 | sta MATHE_A+3 67 | WAITSUZY 68 | MOVE MATHE_D+2,.dl_scb_tilt 69 | _IFEQ 70 | lda #1 71 | sta .dl_scb_xsize+1 72 | _ELSE 73 | bit .dl_scb_tilt 74 | _IFMI 75 | inc 76 | _ENDIF 77 | sta .dl_scb_xsize+1 78 | _ENDIF 79 | 80 | MOVEI .dl_scb,$fc10 81 | draw_DrawSprite: 82 | stz $fd90 83 | lda #1 84 | 85 | STA $FC91 86 | .wait STZ $FD91 87 | bit $fc92 88 | bne .wait 89 | STZ $FD90 90 | rts 91 | 92 | .dl_scb dc.b $d0,$80|$30,0 93 | dc.w 0,.dlimage 94 | .dl_scb_x dc.w 0 95 | .dl_scb_y dc.w 0 96 | .dl_scb_xsize dc.w $100 97 | .dl_scb_ysize dc.w $100 98 | .dl_scb_stretch dc.w 0 99 | .dl_scb_tilt dc.w 0 100 | .dl_scb_color dc.b $e 101 | .dlimage dc.b 2,$10,0 102 | 103 | ******************* 104 | IFD USE_CIRCLE 105 | ******************* 106 | * circle x1,y1,x,a (a=color) 107 | * algo by van Dam/Foley 108 | **************** 109 | deltaE equ temp1 110 | deltaSE equ temp2 111 | 112 | circle:: 113 | sta CIRCLEcolor 114 | 115 | stz x2 116 | stz x2+1 117 | stx y2 118 | stz y2+1 119 | 120 | txa 121 | eor #$ff 122 | sta temp 123 | 124 | inc ; A = -R 125 | asl 126 | tay 127 | lda #$ff 128 | sta temp+1 ; temp = 1-R 129 | 130 | rol 131 | tax 132 | clc 133 | tya 134 | adc #5 135 | sta deltaSE 136 | txa 137 | adc #0 138 | sta deltaSE+1 ; deltaSE = -2R+5 139 | 140 | lda #3 141 | sta deltaE 142 | stz deltaE+1 ; deltaE = 3 143 | 144 | .while jsr circle_points 145 | CMPW y2,x2 146 | beq .exit 147 | 148 | ._1 inc x2 149 | bne ._2 150 | inc x2+1 151 | ._2 152 | clc 153 | lda deltaE 154 | adc #2 155 | sta deltaE 156 | _IFCS 157 | inc deltaE+1 158 | _ENDIF 159 | 160 | lda temp+1 161 | bpl ._3 162 | ADDW deltaE,temp 163 | clc 164 | lda deltaSE 165 | adc #2 166 | sta deltaSE 167 | bcc .while 168 | inc deltaSE+1 169 | bra .while 170 | ._3 ADDW deltaSE,temp 171 | clc 172 | lda deltaSE 173 | adc #4 174 | sta deltaSE 175 | _IFCS 176 | inc deltaSE+1 177 | _ENDIF 178 | dec y2 179 | bne .while 180 | dec y2+1 181 | bra .while 182 | .exit rts 183 | 184 | circle_points 185 | ADDWABC x1,x2,._1x 186 | ADDWABC y1,y2,._1y ; x,y 187 | 188 | MOVE ._1x,._2x 189 | SUBWABC y2,y1,._2y ; x,-y 190 | 191 | ADDWABC x1,y2,._3x 192 | ADDWABC y1,x2,._3y ; y,x 193 | 194 | MOVE ._3x,._4x 195 | SUBWABC x2,y1,._4y ; y,-x 196 | 197 | SUBWABC x2,x1,._5x 198 | MOVE ._2y,._5y ; -x,-y 199 | 200 | MOVE ._5x,._6x 201 | MOVE ._1y,._6y ; -x,y 202 | 203 | SUBWABC y2,x1,._7x 204 | MOVE ._3y,._7y ; -y,x 205 | 206 | MOVE ._7x,._8x 207 | MOVE ._4y,._8y ; -y,-x 208 | 209 | MOVEI CIRCLESCB,$fc10 210 | jmp draw_DrawSprite 211 | 212 | CIRCLESCB 213 | db $c0,$90,00 214 | dw CIRCLESCB2,CIRCLEdata 215 | ._1x dw 0 216 | ._1y dw 0 217 | dw $100,$100 218 | CIRCLEcolor 219 | db $00 220 | CIRCLEdata 221 | db 2,$10,0 222 | 223 | CIRCLESCB2 224 | db $c0,$88,00 225 | dw CIRCLESCB3,CIRCLEdata 226 | ._2x dw 0 227 | ._2y dw 0 228 | CIRCLESCB3 229 | db $c0,$88,00 230 | dw CIRCLESCB4,CIRCLEdata 231 | ._3x dw 0 232 | ._3y dw 0 233 | CIRCLESCB4 234 | db $c0,$88,00 235 | dw CIRCLESCB5,CIRCLEdata 236 | ._4x dw 0 237 | ._4y dw 0 238 | CIRCLESCB5 239 | db $c0,$88,00 240 | dw CIRCLESCB6,CIRCLEdata 241 | ._5x dw 0 242 | ._5y dw 0 243 | CIRCLESCB6 244 | db $c0,$88,00 245 | dw CIRCLESCB7,CIRCLEdata 246 | ._6x dw 0 247 | ._6y dw 0 248 | CIRCLESCB7 249 | db $c0,$88,00 250 | dw CIRCLESCB8,CIRCLEdata 251 | ._7x dw 0 252 | ._7y dw 0 253 | CIRCLESCB8 254 | db $c1,$88,00 255 | dw 0,CIRCLEdata 256 | ._8x dw 0 257 | ._8y dw 0 258 | ******************* 259 | ENDIF 260 | -------------------------------------------------------------------------------- /demos/minidemo/demo02.asm: -------------------------------------------------------------------------------- 1 | DOUBLEBUFFER set 1 ; 1 = double-buffering 2 | DEBUG set 1 ; if defined BLL loader is included 3 | Baudrate set 62500 4 | 5 | include 6 | include 7 | include 8 | include 9 | include 10 | include 11 | ; 12 | ; essential variables 13 | ; 14 | include 15 | include 16 | include 17 | 18 | ; 19 | ; local MACROs 20 | ; 21 | MACRO CLS 22 | lda #\0 23 | jsr cls 24 | ENDM 25 | ; 26 | ; zero-page 27 | ; 28 | BEGIN_ZP 29 | x ds 1 30 | y ds 1 31 | END_ZP 32 | ; 33 | ; main-memory variables 34 | ; 35 | BEGIN_MEM 36 | align 4 37 | screen0 ds SCREEN.LEN 38 | screen1 ds SCREEN.LEN 39 | 40 | END_MEM 41 | ; 42 | ; code 43 | ; 44 | 45 | run LOMEM 46 | 47 | Start:: START_UP 48 | CLEAR_MEM 49 | CLEAR_ZP +STACK 50 | 51 | INITMIKEY 52 | INITSUZY 53 | 54 | INITFONT SMALLFNT,2,15 55 | SET_MINMAX 0,0,160,102 56 | 57 | IF DOUBLEBUFFER 58 | SCRBASE screen0,screen1 59 | ELSE 60 | SCRBASE screen0 61 | ENDIF 62 | 63 | CLS 0 64 | IF DOUBLEBUFFER 65 | SWITCHBUF 66 | CLS 0 67 | ENDIF 68 | 69 | SETRGB pal ; set color 70 | lda #40 71 | sta x 72 | sta y 73 | ; 74 | ; main-loop 75 | ; 76 | .loop 77 | lda x 78 | sta sprite_x 79 | lda y 80 | sta sprite_y 81 | 82 | CLS 0 83 | LDAY spriteSCB 84 | jsr DrawSprite 85 | 86 | SET_XY 10,10 87 | PRINT posTxt 88 | lda x 89 | jsr PrintHex 90 | lda y 91 | jsr PrintHex 92 | IF DOUBLEBUFFER 93 | SWITCHBUF 94 | ENDIF 95 | 96 | .0 READKEY ; see MIKEY.MAC 97 | lda Cursor 98 | beq .0 99 | 100 | bit #$c0 ; up | down 101 | _IFNE 102 | bit #$80 103 | _IFNE 104 | ldx y 105 | _IFNE 106 | dex 107 | _ENDIF 108 | stx y 109 | _ELSE 110 | ldx y 111 | cpx #101 112 | _IFNE 113 | inx 114 | _ENDIF 115 | stx y 116 | _ENDIF 117 | _ELSE 118 | bit #$20 119 | _IFNE 120 | ldx x 121 | _IFNE 122 | dex 123 | _ENDIF 124 | stx x 125 | _ELSE 126 | ldx x 127 | cpx #159 128 | _IFNE 129 | inx 130 | _ENDIF 131 | stx x 132 | _ENDIF 133 | _ENDIF 134 | 135 | jmp .loop 136 | 137 | posTxt dc.b "Position :",0 138 | 139 | 140 | spriteSCB dc.b $c0,$10,$00 141 | dc.w 0 ; no linking 142 | dc.w sprite_data 143 | sprite_x dc.w 0 144 | sprite_y dc.w 0 145 | dc.w $100 146 | dc.w $100 147 | dc.b $0F,$AC ; we use only 3 colors !! 148 | 149 | ; 150 | ; clear screen 151 | ; 152 | cls:: sta cls_color 153 | LDAY clsSCB 154 | jmp DrawSprite 155 | 156 | clsSCB dc.b $c0,$90,$00 157 | dc.w 0,cls_data 158 | dc.w 0,0 159 | dc.w 160*$100,102*$100 160 | cls_color dc.b 00 161 | 162 | cls_data dc.b 2,$10,0 163 | 164 | 165 | include 166 | include 167 | include 168 | include 169 | 170 | pal STANDARD_PAL 171 | 172 | ; 173 | ; 4-quadrant-sprite => action-point is in the middle 174 | ; 175 | 176 | sprite_data ibytes "sprite.spr" 177 | -------------------------------------------------------------------------------- /lynxenc/keys.h: -------------------------------------------------------------------------------- 1 | /* Atari Lynx Encryption Tool 2 | * Copyright (C) 2009 David Huseby 3 | * 4 | * NOTES: 5 | * 6 | * This software is original software written completely by me, but there are 7 | * pieces of data (e.g. the keys.h and loaders.h files) that I got from the 8 | * Atari Age Lynx Programming forum and from people in the Lynx community, 9 | * namely Karri Kaksonen. Without their help, this would have never been 10 | * possible. I was standing on the shoulders of giants. 11 | * 12 | * LICENSE: 13 | * 14 | * This software is provided 'as-is', without any express or implied warranty. 15 | * In no event will the authors be held liable for any damages arising from the 16 | * use of this software. 17 | * 18 | * Permission is granted to anyone to use this software for any purpose, 19 | * including commercial applications, and to alter it and redistribute it 20 | * freely, subject to the following restrictions: 21 | * 22 | * 1. The origin of this software must not be misrepresented; you must not 23 | * claim that you wrote the original software. If you use this software in a 24 | * product, an acknowledgment in the product documentation would be appreciated 25 | * but is not required. 26 | * 27 | * 2. Altered source versions must be plainly marked as such, and must not be 28 | * misrepresented as being the original software. 29 | * 30 | * 3. This notice may not be removed or altered from any source distribution. 31 | */ 32 | 33 | #ifndef _KEYS_H_ 34 | #define _KEYS_H_ 35 | 36 | /* This is the public modulus from the Lynx ROM */ 37 | const unsigned char lynx_public_mod[LYNX_RSA_KEY_SIZE] = { 38 | 0x35, 0xB5, 0xA3, 0x94, 0x28, 0x06, 0xD8, 0xA2, 39 | 0x26, 0x95, 0xD7, 0x71, 0xB2, 0x3C, 0xFD, 0x56, 40 | 0x1C, 0x4A, 0x19, 0xB6, 0xA3, 0xB0, 0x26, 0x00, 41 | 0x36, 0x5A, 0x30, 0x6E, 0x3C, 0x4D, 0x63, 0x38, 42 | 0x1B, 0xD4, 0x1C, 0x13, 0x64, 0x89, 0x36, 0x4C, 43 | 0xF2, 0xBA, 0x2A, 0x58, 0xF4, 0xFE, 0xE1, 0xFD, 44 | 0xAC, 0x7E, 0x79 45 | }; 46 | 47 | /* This is the known public exponent from the Lynx ROM. 48 | * NOTE: the Lynx ROM doesn't actually do a true RSA modular exponentiation 49 | * using the above modulus and this exponent. Instead it takes each block of 50 | * encrypted data and uses Montgomery multiplication to do a modular 51 | * multiplication of the data block with itself twice, thus raising it to the 52 | * third power. */ 53 | const unsigned char lynx_public_exp[LYNX_RSA_KEY_SIZE] = { 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x03 61 | }; 62 | 63 | /* This is the known private exponent generated by xor'ing the three keyfile 64 | * blocks together. */ 65 | const unsigned char lynx_private_exp[LYNX_RSA_KEY_SIZE] = { 66 | 0x23, 0xce, 0x6d, 0x0d, 0x70, 0x04, 0x90, 0x6c, 67 | 0x19, 0xb9, 0x3a, 0x4b, 0xcc, 0x28, 0xa8, 0xe4, 68 | 0x12, 0xdc, 0x11, 0x24, 0x6d, 0x20, 0x19, 0x55, 69 | 0x79, 0x87, 0xab, 0x5c, 0xa8, 0x18, 0xa3, 0xd3, 70 | 0xc8, 0xe3, 0x27, 0x6d, 0x42, 0x70, 0xcb, 0x80, 71 | 0x21, 0xd6, 0xbd, 0xa4, 0x29, 0x6d, 0x47, 0xb1, 72 | 0xe5, 0xe2, 0xa3 73 | }; 74 | 75 | /* NOTE: the following keyfile dumps are no longer needed as they are used to 76 | * calculate the Lynx private exponent which is listed above. I keep them here 77 | * for posterity sake so that we don't lose the knowledge that the old Amiga 78 | * based encryption system used three flopy disks, each containing the following 79 | * blocks of data that it xor'd together to get the private key in memory. 80 | */ 81 | 82 | /* This is the Atari keyfile.1 */ 83 | const unsigned char keyfile_1[LYNX_RSA_KEY_SIZE] = { 84 | 0xea, 0x6c, 0xad, 0xb2, 0xab, 0xb1, 0xd3, 0xee, 85 | 0x85, 0x6f, 0xd3, 0x36, 0xc0, 0xc1, 0x16, 0x1d, 86 | 0x31, 0x44, 0x65, 0x1a, 0x22, 0x81, 0xb5, 0xb8, 87 | 0x26, 0xdd, 0xce, 0x0f, 0x8f, 0xbb, 0x25, 0xc8, 88 | 0x1d, 0x34, 0x03, 0x1f, 0xb4, 0xb9, 0xae, 0xda, 89 | 0xcf, 0xde, 0x75, 0xc1, 0xd2, 0xed, 0x35, 0x4b, 90 | 0xcc, 0x11, 0x58 91 | }; 92 | 93 | /* This is the Atari keyfile.2 */ 94 | const unsigned char keyfile_2[LYNX_RSA_KEY_SIZE] = { 95 | 0x14, 0xd6, 0x30, 0x08, 0x35, 0x57, 0x28, 0xef, 96 | 0x2b, 0xa3, 0x25, 0xb7, 0x11, 0x8c, 0x62, 0x2d, 97 | 0x16, 0x7a, 0x7d, 0xee, 0x57, 0xe7, 0x37, 0x18, 98 | 0xc9, 0x96, 0xe5, 0xa9, 0x63, 0x49, 0x68, 0x15, 99 | 0xf6, 0x6c, 0x12, 0x8c, 0x9e, 0xeb, 0xda, 0xef, 100 | 0xbd, 0x75, 0x3a, 0x9e, 0x7d, 0x02, 0xe6, 0xe9, 101 | 0xfd, 0xd7, 0x97 102 | }; 103 | 104 | /* This is the Atari keyfile.3 */ 105 | const unsigned char keyfile_3[LYNX_RSA_KEY_SIZE] = { 106 | 0xdd, 0x74, 0xf0, 0xb7, 0xee, 0xe2, 0x6b, 0x6d, 107 | 0xb7, 0x75, 0xcc, 0xca, 0x1d, 0x65, 0xdc, 0xd4, 108 | 0x35, 0xe2, 0x09, 0xd0, 0x18, 0x46, 0x9b, 0xf5, 109 | 0x96, 0xcc, 0x80, 0xfa, 0x44, 0xea, 0xee, 0x0e, 110 | 0x23, 0xbb, 0x36, 0xfe, 0x68, 0x22, 0xbf, 0xb5, 111 | 0x53, 0x7d, 0xf2, 0xfb, 0x86, 0x82, 0x94, 0x13, 112 | 0xd4, 0x24, 0x6c 113 | }; 114 | 115 | #endif /*_KEYS_H_ */ 116 | 117 | --------------------------------------------------------------------------------