dflat language update

This is the best place to discuss about the various Oric operating systems like Sedoric, Randos, FT-Dos, and others, as well as serious software, utilities, word processors, disassemblers, etc... that runs on oric computers.
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

I'll for sure try it on a real Oric as soon as its possible.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

ibisum wrote: Tue Jan 12, 2021 5:15 pm I'll for sure try it on a real Oric as soon as its possible.
Ok! I have uploaded source to GitHub. Specifically the emulator is in the folder Oric-DFLAT\emulator\

So you can copy that whole folder and to run Oric dflat - else you could also just copy these files to your local Oricutron installation:
- oricutron.cfg (override Pravetz with dflat ROM and starts this machine by default)
- roms\dflat.pch (patch file needed for load/save to tape)
- roms\dflat.rom (the actual ROM)
- dfprogs\ (contains some programs)
- tapes\ (contains dflat .tap and .wav files)
- Util\ (contains source for the utilities listed below)
- dftap2txt.exe
- dftxt2tap.exe
- dftap2wav.exe (only need this to make a wav to load in a real Oric)

So once you have Oric dflat running and assuming you have kept the files above, then try this;
- type : load "tet.tap" [dflat will load 41 blocks of program]
- type : _start() [dflat will run the Tetris demo game]

Cursor keys and space are used for control;
- On game start, quickly press Left to turn off music! (Right to turn back on if you somehow want to hear more :-D )
- Press space to play a game
- In game, Left/Right control shape position, Space rotates clockwise and Down drops the shape rapidly
- In high score, Up/Down selects a character, Right/Left moves to adjacent character, Space to complete

Happy to take questions - of course like most of us I have to balance my work, home and Oric development time :-)
User avatar
rax
Flying Officer
Posts: 193
Joined: Tue Jul 24, 2018 3:16 pm

Re: dflat language update

Post by rax »

Hi 6502Nerd,

Congratulations on dflat. I like it :).
I like the idea of faster work and built-in assembler. Expect to see it in a stable version.

I decided to try the language in a real program, but i have a problem with the dftxt2tap tool. Maybe i'm doing something wrong.
I am attaching a short video with what is happening. This Windows 7 is on a virtual machine.

User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Hello rax!

My thanks to you for trying this. My instructions are not clear enough, I will work on that but watched the video and I can see what is happening..

1) You can edit a dflat program in a text editor like npp then save it as a .txt file (or indeed .prg as I have used - up to you). You do not need to use line numbers and must make sure there is no blank line in the source code except for at the end of the file as this is how dflat will decide to stop loading!
2) Now to convert the .txt to .tap file format use the dftxt2tap.exe utility, with '-lN' option for example dftxt2tap -l10 <source.txt> <dest.tap>
2.1) the -lN option prepends line numbers to the input .txt file starting at N and incrementing by 10 for each line. This is essential if not using line numbers during the text editing session.
3) In the emulator you must use 'tload' rather than 'load' keyword
3.1) 'tload' loads a .tap file which basically contains the program as text. All that is happening is that the dflat input is reading from file rather than keyboard, and at every carriage return tokenises the text line to save in to memory. This can take some time by the way so tload can take a longer time to load. tload stops when it reads an empty line - hence why a blank line must be at the end of the .txt file!
3.2) 'load' loads a .tap file which has already been tokenised and saved with the 'save' keyword. As this is a binary format, it loads much more quickly. However this is not then convertible back to .txt format for editing in something like npp
3.3) 'tload' is the provision to allow saving the tokenised program in Oric as a text file. This can be loaded back with 'tload' but also can use a utility to convert to .txt
3.4) The utility to convert a file saved with 'tload' to txt for PC is dftap2txt.exe -l <source.tap> <dest.txt> (the -l option in this case strips line numbers before outputting to the text file).

Hope this helps - I will need to make the documentation and quick start clearer I think! Probably I should use consistent file extension naming - .tap is used whether encoded in text or tokenised form which is confusing but not sure if Oricutron needs it to be called .tap (will check). If I have different extensions then will be easier to know which files must use 'tload' and which must use 'load'.

Thank you very much for taking the time to look at dflat and provide your feedback! :-)
User avatar
rax
Flying Officer
Posts: 193
Joined: Tue Jul 24, 2018 3:16 pm

Re: dflat language update

Post by rax »

Thanks for the very very quick response :)

"tload" works great! Clever idea to load as a text file (albeit larger).

Тhe thing i miss is a table with all the available commands and a very short description of the given command, and memory map.

Мy question is: "can current tools (dftxt2tap and etc) be compiled for Linux?"

I think after a while I will be able to give some feedback.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Great - glad that I explained it well enough and you know the purpose of tload now!

Documentation is also in GitHub as a set of wiki pages broken down in to sections:

https://github.com/6502Nerd/dflat/wiki

It is not in a simplified summary listing all keywords etc, nor do I have the memory map (although you can see in the source file zeropage.i where everything goes!). I will improve the documentation further to make it easier to scan through.

On the tools - they are compiled in Visual Studio, but the source files are very basic C/C++ with no special Windows includes. So they should compile to Unix/Linux with little change. Just take the .cpp and .h files from the 'utils' folder, should not need all the VS config and metadata files.

Hope it helps and I will continue to make some improvements to dflat and the docs. In addition, I will post some more programs to help show how dflat can be used - I already did a software sprite example which uses the inline assembler plus a very simple Sierpinksi Triangle demo. These will be put up sometime this week.
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: dflat language update

Post by iss »

Well, you woke my interest in porting the build system under Linux ;),
6502Nerd wrote: Wed Jan 20, 2021 4:12 pm...with no special Windows includes.
The "security" variant of some functions are undefined under Linux/Posix i.e. fopen_s, _itoa_s, strcpy_s, etc. but this is easy fix.
What I'll do first - a script to translate as65 syntax to xa compatible source then some bash scripts should do the job.
I'll post feedback when ready.
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Hi iss

It would be pretty cool to translate as65 assembler syntax to something else. Yes you spotted these _s variants and easy to fix indeed.

Looking forward to your thoughts :-)
User avatar
rax
Flying Officer
Posts: 193
Joined: Tue Jul 24, 2018 3:16 pm

Re: dflat language update

Post by rax »

Hi :),

I tried to make a small game using Dflat. Just something simple, using my humble abilities. Please be lenient. I liked the language. It is easy to write and easier to understand than BASIC. I will share my impressions and problems with the language in another post.

There is a little problem in the game that I guess 6502Nerd knows about. I guess it's at the ROM level.

I can post a short video in a later post, but for now the game will remain a surprise for those who want to try it.

Little instruction:
- put the file in the tapes directory
- start emulator and DFLAT
- type: tload "explorer7.tap"
- type: _start()

Enjoy and comment.

Code: Select all

; * EXPLORER7 in DFLAT! *
; * 01/2021 rax *
def_start()
	dim code[100]
	dim prtspr[100]
	dim tileset[40*6/2]
	dim level[200,5]
	dim s$[40]
	_asm(2):_asm(2):_asm(2)
	_asm2(2):_asm2(2):_asm2(2)
	_init()
	_hlp()
	repeat
		_game()
		cls
		if gamestate == 2
			_prttxt(2,45,"Congratulations! Mission accomplished.")
		else
			_prttxt(15,45,"GAME OVER")
		endif
		print "          Press any key..."
		wait(100)
		c=get(1)
	until(0)
enddef
def_init()
	text:paper(0):ink(7):cursor(1)
	;;chars
	for a=0,767,1: read v: poke 0xb500+a,v: next
	;;screen
	for a=0,27*40,1:read v: poke 0xbb80+a,v:next
	printat 13,25,"    Wait..."
	poke 0xbb80+25*40+12,12
	;;
	;;tileset
	for y=0,5,1:for i=0,39,1:read v:poke tileset+i*6+y,v:next:next
	;;
	;;level
	for i=0,1999,1:read v: poke level+i,v:next
	;;
	;;done
	printat 13,25,"Press any key..."
	poke 0xbb80+25*40+12,12
	c=get(1)
enddef
def_hlp()
	hires
	dim str$[40]
	str$="-Hello Commander,": poke str$,1
	_prttxt(1,40,str$)
	str$="-The earth is in danger. There is a": poke str$,3
	_prttxt(1,60,str$)
	str$="-galactic war. You and your crew were": poke str$,3
	_prttxt(1,70,str$)
	str$="-on a reconnaissance mission in outer": poke str$,3
	_prttxt(1,80,str$)
	str$="-space. You must return successfully": poke str$,3
	_prttxt(1,90,str$)
	str$="-to base, avoiding obstacles left for": poke str$,3
	_prttxt(1,100,str$)
	str$="-enemy ships.": poke str$,3
	_prttxt(1,110,str$)
	str$="-Use the arrow keys to move the ship": poke str$,2
	_prttxt(1,130,str$)
	str$="-Good luck": poke str$,5
	_prttxt(1,150,str$)
	print "          Press any key..."
	c=get(1)
enddef
def_game()
	hires
	levelx=0
	playery=2
	playerx=5
	coladdr=0xaaf0+playerx+121
	gamestate=0
	play 0,1,0,0
	sound 1,100,5
	repeat
		c=stick()
		;;
		_spr(playerx-1,playery,39)
		if c&4
			if playery>0
				_spr(playerx,playery,39)
				playery=playery-1
			endif
		elif c&8
			if playery<4
				_spr(playerx,playery,39)
				playery=playery+1
			endif
		endif
		_moveScreen()
		_spr(playerx-1,playery,27)
		_spr(playerx,playery,28)
		_printlvldata()
		;;
		;;collision check
		if peek(coladdr+playery*240)>64
			gamestate=1
			sound 1,0,0
			;play 7,7,9,5000
		endif
	until(gamestate)
	play 0,0,0,0
enddef
def_spr(x,y,e)
	doke psscreen+1, 0xaaf0+x+y*240
	doke psaddr+1, tileset+e*6
	a=call(prtspr,0,0,0)
enddef
def_moveScreen()
	a=call(code,0,0,0)
enddef
def_printlvldata()
	tmplva = level+levelx
	for z=0,4,1
		_spr(39,z,peek(tmplva))
		tmplva = tmplva + 400
	next
	levelx=levelx+1
	if levelx==400
		gamestate=2
	endif
enddef
def_prttxt(x,y,s$)
	l=len(s$)
	for n=0,l,1
		scraddr=0xa000+x+n+y*40
		c=peek(s$+n)
		chraddr=0x9800+c*8
		poke scraddr+280,126
		for i=0,7,1
			if c>31
				poke scraddr+i*40,peek(chraddr+i)|64
			else
				poke scraddr+i*40,c
			endif
		next
		play 700,0,1,200
	next
	poke scraddr+1,64
enddef
;;chars
data 0,0,0,0,0,0,0,0,
data 12,12,12,12,12,0,12,0,
data 54,54,54,0,0,0,0,0,
data 20,20,62,20,62,20,20,0,
data 8,30,44,28,26,60,8,0,
data 48,50,6,12,24,54,38,0,
data 24,44,44,24,46,44,30,0,
data 24,24,24,0,0,0,0,0,
data 12,24,48,48,48,24,12,0,
data 24,12,6,6,6,12,24,0,
data 8,42,28,8,28,42,8,0,
data 0,24,24,62,24,24,0,0,
data 0,0,0,0,0,12,12,24,
data 0,0,0,62,0,0,0,0,
data 0,0,0,0,0,12,12,0,
data 0,2,6,12,24,48,32,0,
data 28,50,54,58,50,50,28,0,
data 12,28,12,12,12,12,30,0,
data 28,54,6,12,24,48,62,0,
data 62,6,12,28,6,54,28,0,
data 4,12,28,44,62,12,12,0,
data 62,48,60,6,6,38,28,0,
data 12,24,48,60,50,50,28,0,
data 62,2,6,12,24,24,24,0,
data 28,50,50,28,50,50,28,0,
data 28,54,54,30,6,12,24,0,
data 0,0,12,0,0,12,0,0,
data 0,0,12,0,0,12,12,24,
data 6,12,24,48,24,12,6,0,
data 0,0,62,0,62,0,0,0,
data 48,24,12,6,12,24,48,0,
data 28,54,6,12,12,0,12,0,
data 28,50,50,54,54,48,30,0,
data 8,28,50,50,62,50,50,0,
data 60,50,50,60,50,50,60,0,
data 28,50,48,48,48,50,28,0,
data 60,50,50,50,50,50,60,0,
data 62,48,48,60,48,48,62,0,
data 62,48,48,60,48,48,48,0,
data 30,48,48,48,54,50,30,0,
data 50,50,50,62,50,50,50,0,
data 30,12,12,12,12,12,30,0,
data 6,6,6,6,6,38,28,0,
data 50,52,56,48,56,60,54,0,
data 48,48,48,48,48,48,62,0,
data 34,54,58,58,50,50,50,0,
data 50,50,50,58,54,50,50,0,
data 28,50,50,50,50,50,28,0,
data 60,34,34,60,48,48,48,0,
data 28,50,50,50,58,52,26,0,
data 60,50,50,60,56,52,50,0,
data 28,50,48,28,6,38,28,0,
data 62,24,24,24,24,24,24,0,
data 50,50,50,50,50,50,28,0,
data 50,50,50,50,50,28,8,0,
data 50,50,50,58,58,54,34,0,
data 54,54,20,8,20,54,54,0,
data 50,50,20,24,24,24,24,0,
data 62,6,12,24,48,48,62,0,
data 60,48,48,48,48,48,60,0,
data 0,32,48,24,12,6,2,0,
data 30,6,6,6,6,6,30,0,
data 8,28,54,34,0,0,0,0,
data 0,0,0,0,0,0,63,0,
data 62,0,28,16,16,28,0,62,
data 0,0,28,2,30,38,30,0,
data 32,32,60,50,50,50,60,0,
data 0,0,30,48,48,48,30,0,
data 2,2,30,38,38,38,30,0,
data 0,0,28,50,62,48,30,0,
data 12,18,16,60,24,24,24,0,
data 0,0,28,38,38,30,6,28,
data 32,32,60,50,50,50,50,0,
data 8,0,56,24,24,24,60,0,
data 4,0,28,12,12,12,44,24,
data 48,48,50,52,56,52,50,0,
data 56,24,24,24,24,24,60,0,
data 0,0,54,58,58,58,50,0,
data 0,0,60,50,50,50,50,0,
data 0,0,28,50,50,50,28,0,
data 0,0,60,50,50,60,48,48,
data 0,0,30,38,38,30,6,6,
data 0,0,46,48,48,48,48,0,
data 0,0,30,48,28,6,60,0,
data 24,24,60,24,24,26,12,0,
data 0,0,50,50,50,54,26,0,
data 0,0,50,50,50,28,8,0,
data 0,0,50,50,58,58,54,0,
data 0,0,54,20,8,20,54,0,
data 0,0,54,54,54,30,6,28,
data 0,0,62,6,12,24,62,0,
data 12,24,24,48,24,24,12,0,
data 12,12,12,12,12,12,12,12,
data 24,12,12,6,12,12,24,0,
data 42,21,42,21,42,21,42,21,
data 63,63,63,63,63,63,63,63
;;screen
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,19,19,19,19,19
data 22,22,17,17,17,22,17,22,17,22,17,17,22,22,17,22,22,22,22,17
data 17,22,17,17,22,22,17,17,17,22,17,17,22,22,22,20,20,20,19,19
data 22,22,17,22,22,22,17,22,17,22,17,22,17,22,17,22,22,22,17,22
data 17,22,17,22,17,22,17,22,22,22,17,22,17,22,22,22,19,20,19,19
data 22,22,17,17,22,22,22,17,22,22,17,17,22,22,17,22,22,22,17,22
data 17,22,17,17,22,22,17,17,22,22,17,17,22,22,22,22,22,20,19,19
data 22,22,17,17,17,22,17,22,17,22,17,22,22,22,17,17,17,22,17,17
data 22,22,17,22,17,22,17,17,17,22,17,22,17,22,22,22,22,20,22,22
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
data 22,19,19,19,22,19,19,22,22,22,22,22,22,22,22,22,22,22,19,19
data 19,19,19,19,19,19,22,19,19,19,22,19,19,19,22,19,19,22,19,22
data 22,22,22,22,22,22,22,22,22,19,19,19,19,19,19,19,19,19,22,22
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
data 22,19,19,19,19,19,19,19,19,22,22,22,22,22,22,22,22,22,22,22
data 22,22,22,22,22,18,22,22,22,22,22,22,18,22,18,22,22,18,22,22
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
data 22,22,18,22,18,18,18,18,22,22,18,18,18,19,18,18,22,18,22,18
data 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22
data 18,18,18,18,18,18,19,18,18,18,18,18,18,18,19,18,18,18,19,18
data 21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,18
data 19,19,18,18,18,19,18,18,19,18,18,19,18,19,18,18,18,19,18,19
data 22,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,18
data 18,18,19,18,18,18,18,19,18,18,18,19,18,18,18,18,19,18,18,18
data 22,22,22,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22
data 18,18,18,18,18,19,18,18,18,19,19,18,18,18,18,18,18,18,19,19
data 21,21,21,21,21,21,23,23,21,21,21,22,22,22,22,22,22,22,22,22
data 22,22,22,18,18,18,18,18,18,18,18,18,18,18,19,19,18,18,18,18
data 21,21,21,21,21,21,23,23,23,23,21,21,21,21,21,22,22,22,22,22
data 22,22,22,22,21,21,22,22,21,22,21,21,22,21,18,18,18,18,22,21
data 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22
data 22,22,22,22,21,21,22,22,21,22,21,21,22,21,22,21,21,22,22,21
data 22,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22
data 22,22,22,22,21,21,22,22,21,22,21,21,22,21,22,21,21,22,22,21
data 21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22
data 22,19,19,19,21,21,19,19,19,19,21,21,19,19,19,21,21,19,19,21
data 21,21,21,21,21,20,20,20,20,20,20,20,20,23,23,23,20,20,20,20
data 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,21,21,19,19,19
data 20,20,20,20,20,20,20,23,23,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,19,19,19,19,19,19,19,19,19,19,19
data 20,20,20,20,20,20,20,20,20,20,20,20,23,23,20,20,20,20,23,23
data 20,20,20,20,20,23,23,23,20,20,20,20,20,20,20,20,20,20,23,23
data 23,23,23,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,23,23,23,20,20,20,20,20
data 20,20,20,20,20,20,23,23,20,20,20,20,20,20,20,20,20,20,20,20
data 23,23,23,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,23,23,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,23,23,20,20,20,20,20,23,23,20,20
data 20,20,20,23,23,23,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,23,23,23,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
;;sprites
data 0x06, 0x7f, 0x41, 0x60, 0x7f, 0x7f, 0x4c, 0x7f, 0x50, 0x7f, 0x43 
data 0x69, 0x70, 0xc0, 0xc1, 0xc0, 0x7f, 0x7e, 0x7f, 0x6a, 0x40, 0x5e 
data 0x5e, 0x40, 0x40, 0x40, 0x40, 0xe0, 0x40, 0x43, 0x70, 0x40, 0x61 
data 0x4c, 0x4c, 0x4c, 0xc0, 0x40, 0x40, 0x40, 0x03, 0x7f, 0x47, 0x78 
data 0x5f, 0x7e, 0x4c, 0x7f, 0x7d, 0x7f, 0x4f, 0x7f, 0x7c, 0x6a, 0x6a 
data 0x6a, 0xd5, 0xd5, 0xd5, 0x5c, 0xff, 0xc0, 0x7f, 0x40, 0x48, 0x48 
data 0x40, 0x47, 0x70, 0x46, 0x78, 0x48, 0x52, 0x44, 0x5e, 0x5e, 0x5e 
data 0x5e, 0x5e, 0x40, 0x06, 0x7f, 0x57, 0x7a, 0x7f, 0x7f, 0x56, 0x5e 
data 0x7f, 0x7f, 0x77, 0x7f, 0x7f, 0xc0, 0xc1, 0xc0, 0x7f, 0x7e, 0x7f 
data 0x7e, 0x67, 0x7f, 0xc0, 0x5e, 0x5c, 0x5c, 0x40, 0x43, 0xf3, 0x4d 
data 0x7c, 0x54, 0x40, 0x4c, 0x48, 0x4c, 0xc0, 0xd0, 0xdc, 0x40, 0x03 
data 0x7f, 0x7f, 0x7f, 0x57, 0x7a, 0x5e, 0x56, 0x7f, 0x7f, 0x7f, 0x7f 
data 0x7b, 0x6a, 0x6a, 0x6e, 0xd5, 0xd5, 0xd1, 0x5c, 0xff, 0xc0, 0x7f 
data 0xc0, 0x6a, 0xd5, 0x4e, 0x47, 0xc0, 0x4d, 0x7c, 0x48, 0x40, 0x48 
data 0x4c, 0x5e, 0x5e, 0xd0, 0xd8, 0x40, 0x06, 0x7f, 0x5f, 0x7e, 0x47 
data 0x78, 0x7f, 0x4c, 0x7f, 0x6f, 0x4f, 0x7f, 0x7c, 0xc0, 0xc1, 0xcc 
data 0x7f, 0x7e, 0x73, 0x6a, 0x7c, 0x4c, 0x4c, 0x5e, 0xc1, 0x7e, 0x40 
data 0xe0, 0x7c, 0x4f, 0x7c, 0x40, 0x52, 0x5e, 0x44, 0x4c, 0xc0, 0xdc 
data 0xd0, 0x40, 0x03, 0x7f, 0x7f, 0x7f, 0x41, 0x60, 0x7f, 0x4c, 0x7f 
data 0x42, 0x43, 0x65, 0x70, 0x6a, 0x6a, 0x72, 0xd5, 0xd5, 0xcd, 0x40 
data 0xff, 0x4c, 0x4c, 0x40, 0x6a, 0xd5, 0x40, 0x7f, 0x60, 0xe8, 0xc5 
data 0x40, 0x61, 0x4c, 0x4c, 0x5e, 0x5e, 0x5e, 0x5e, 0x40
;;level
data 39,39,39,39,39,39,39,39,39,19,39,39,39,39,39,39
data 39,39,39,39,39,39,19,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,19,39,39,39,39
data 39,39,39,39,39,39,39,39,39,19,39,39,39,39,39,39
data 39,39,19,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,19,39,39,39,39,39,39,39,39,39,39,39,39,39
data 19,39,39,39,39,39,39,4,9,9,9,1,1,1,1,1
data 1,1,1,1,1,1,1,1,9,9,1,9,1,9,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,9,9,5,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,4,9,1,9,9,9,1,9,1,9
data 5,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,19,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,19,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,4,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9
data 9,9,1,9,1,9,5,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,19,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,24,39
data 24,39,24,39,19,19,19,39,39,19,19,39,19,19,39,39
data 39,39,39,39,39,39,19,39,39,39,39,39,39,39,39,39
data 39,19,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,19,39,39,39,39,39,39,39,39
data 39,39,39,19,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,19,39,39,39
data 39,39,39,39,39,39,39,39,39,39,19,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,4,9,9,1,1
data 1,9,9,9,5,34,4,5,39,39,33,39,7,39,4,9
data 9,9,9,1,1,1,1,5,7,4,9,1,1,1,1,1
data 9,5,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,2,8,8,8,8,8,3,39,21,39,2,8,8
data 8,8,3,39,39,39,39,39,33,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,21,22,29,30,34,29,30
data 22,39,39,39,39,39,39,39,39,39,39,39,39,19,39,19
data 39,39,39,39,39,39,39,39,39,39,39,19,39,39,39,39
data 39,39,39,39,24,39,39,39,39,39,39,39,39,25,39,39
data 39,39,39,39,39,39,39,4,9,9,9,5,7,4,9,1
data 9,1,1,1,1,1,1,1,9,9,1,1,1,1,5,39
data 39,39,7,39,33,39,39,39,39,39,39,39,39,39,39,19
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,15,14,39,34,39,18,17,21,34,15,14,39,39,39
data 39,39,39,39,39,39,39,39,2,8,8,8,11,11,8,8
data 8,8,8,11,11,8,8,11,12,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,29,30,39,39,39,39,39,13,13
data 13,13,14,39,19,39,39,39,19,39,19,39,19,39,19,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,19,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,19,39
data 39,39,39,39,39,39,39,39,39,39,39,39,19,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,19,39,39,39,39
data 39,39,39,39,39,19,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,2,3,33,2,3,39,39,39,39,39,4,9
data 5,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,4,9,9,5,39,39,39,39,4,9,9,9,5
data 39,39,39,39,39,39,39,10,11,11,11,11,11,11,11,11
data 11,11,11,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,8,8,3,39,39,39,39,39,2,8,8,1,11
data 11,12,39,39,39,39,39,10,11,11,9,9,9,9,9,9
data 9,11,11,12,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,24,35,39,39,39,24,39,39,25,29,30,25
data 39,39,39,39,14,39,24,35,39,29,30,23,39,17,39,39
data 23,39,39,39,39,39,39,39,39,39,39,39,39,39,39,33
data 39,36,4,9,9,9,5,33,39,39,4,9,9,5,39,39
data 39,39,39,39,39,39,39,39,39,39,19,39,39,39,39,39
data 39,39,39,39,29,30,13,15,14,18,17,21,39,39,39,39
data 10,11,9,9,11,9,11,9,9,9,9,9,9,11,12,39
data 39,39,39,39,39,10,11,11,9,9,9,5,39,39,4,9
data 9,9,5,39,39,33,33,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,16,17,39,39,39,39,39,13,13
data 13,13,14,39,19,19,39,39,19,39,19,39,19,39,19,39
data 39,39,19,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,19,39,39,39,39,39,39,39,39,35,39,39
data 29,30,22,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,19,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 19,39,39,39,39,39,39,39,39,39,39,39,39,39,39,6
data 39,29,30,39,35,39,19,39,39,39,39,29,30,39,39,39
data 39,39,39,2,1,1,1,1,1,3,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,2,8,6,8,3,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,4,9,9,9,5,4,9,9,9,5,33,4,9
data 5,9,9,9,9,9,11,11,11,11,11,9,9,9,5,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,29,30,39,39,39,39
data 39,39,39,13,13,14,39,29,30,13,14,39,16,16,16,17
data 39,39,39,13,13,13,13,13,39,13,13,14,16,17,39,39
data 13,14,39,39,39,39,39,17,17,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,10,9,9,9,9,9,9,9,9,11,12,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 33,39,39,39,39,39,39,39,39,39,39,21,22,21,22,29
data 30,29,30,22,39,39,39,18,17,29,30,39,21,21,13,15
data 13,15,14,39,19,19,19,39,19,39,19,39,19,19,39,39
data 39,39,39,39,39,39,39,19,39,39,39,39,39,39,39,39
data 19,39,39,39,39,39,39,39,39,39,39,2,8,1,8,8
data 1,1,1,8,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,8,8,1
data 8,1,1,8,1,8,8,8,8,8,8,1,1,8,8,8
data 8,8,8,1,1,1,1,1,1,1,8,8,8,8,8,8
data 8,8,8,8,8,8,8,8,8,1,1,1,1,1,3,20
data 20,20,20,20,20,20,2,8,8,8,8,8,8,8,8,8
data 8,8,8,8,8,8,3,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39
data 39,39,39,39,2,8,8,8,8,8,8,8,8,8,8,8
data 8,8,8,8,8,8,8,8,8,8,1,1,8,3,39,39
data 39,21,39,13,15,14,39,15,14,15,14,39,16,16,18,17
data 21,39,22,13,13,15,13,13,39,15,13,14,18,17,22,39
data 15,14,39,22,22,22,39,18,17,22,22,22,22,39,18,17
data 14,14,39,39,2,8,8,8,8,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
data 20,20,20,8,8,8,8,8,8,8,8,1,1,1,1,1
data 1,1,1,1,8,8,8,1,1,1,1,8,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
;;asm move screen
def_asm(option)
	.opt option
	.org code
	.lda #0xf1
	.sta addr1+1
	.lda #0xf0
	.sta addr2+1
	.lda #0xAA
	.sta addr1+2
	.sta addr2+2
	.ldy #5
	.ldx #0
.loop
.addr1
	.lda 1234,x
.addr2
	.sta 1234,x
	.inx
	.bne loop
	.inc addr1+2
	.inc addr2+2
	.dey
	.bne loop
.color
	.lda #6
	.sta 43760
	.sta 43840
	.sta 43920
	.sta 44000
	.sta 44080
	.sta 44160
	.sta 44240
	.sta 44320
	.sta 44400
	.sta 44480
	.sta 44560
	.sta 44640
	.sta 44720
	.sta 44800
	.sta 44880
	.lda #3
	.sta 43800
	.sta 43880
	.sta 43960
	.sta 44040
	.sta 44120
	.sta 44200
	.sta 44280
	.sta 44360
	.sta 44440
	.sta 44520
	.sta 44600
	.sta 44680
	.sta 44760
	.sta 44840
	.rts
enddef
;; asm  print sprite
def_asm2(option)
	.opt option
	.org prtspr
	.ldx #0
	.ldy #0
.psloop
.psaddr
	.lda 1234,x 
.psscreen
	.sta 1234,y	
	.clc
	.tya
	.adc #40
	.tay
	.inx
	.cpx #6
	.bne psloop
	.rts
enddef

p.s. I could not attach a file with the extension ".prg" or ".txt" that's why the game code is in the post
Attachments
explorer7.tap
(20.18 KiB) Downloaded 180 times
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

Hi Rax (BTW - I have been trying to send you a PM, but stuck in my Outbox and I cannot see how to release it)

First of all - thank you for trying dflat and producing a very nice program! I will not give away too much so that others can try and be pleasantly surprised :-)

Thanks for sharing your experience of using dflat - I am glad you find it easier than BASIC. I liked the way you created colourful strings by keeping a spare character at the beginning then poking with the ink colour you want. I never thought of that! :)

You have a lot of data fonts, graphics and level information! I am working on the dfbin2tap utility so that graphics, fonts etc. can be converted from PC binary formats to dflat format. Maybe will do something in the other direction too.

I look forward to hearing about the issues and suggestions you have - but I don't have bugs in my code of course, only features! :wink:
With 35 bytes of ROM spare, I am sure there is something more I can do :lol:

Thank you again, I feel really happy you did such a nice program using something I made :D
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

Cute game, but .. pretty hard .. ;) No spoilers, but I really like the splash screen!
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: dflat language update

Post by iss »

As promised here is the PR for Linux port: https://github.com/6502Nerd/dflat/pull/1

This quick port allows compiling of the 3 command-line utilities and 'dflat.rom' + proper 'dflat.pch' file.
Some work is needed for full portability (i.e. for big-endian platforms) - mainly the WAV-header structure and calculations of 'datalength' and 'riff_size' fields, which assumes 'int' is 32-bit little-endian number - maybe using uint32_t from <stdint.h> will be the best solution.

Important: Please, check before merging if as65.exe under Windows accepts '/' as include path separator instead of '\'.

Else, @6502Nerd, congrats for the language and for the high quality assembler sources!
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: dflat language update

Post by ibisum »

Hey iss, I heard you like port PR's in your PR, so I put Darwin in a PR of your PR for you to submit as a new PR ..
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

ibisum wrote: Fri Jan 22, 2021 6:00 pm Cute game, but .. pretty hard .. ;) No spoilers, but I really like the splash screen!
It is a cute game! Rax mentioned some issue which you can see when playing - there is a slow down when any key is pressed and held. There's several reasons for this which I won't go in to here. However after loading to the Oric - type these lines:
785 poke 0x5a,0
1055 poke 0x5a,32

Because I already noticed this issue, I already made a workaround which is available with poke-ing only. The above disables then re-enabled the ctrl-c checking dflat does. When disabled then the game then the game flows more nicely :-D

rax has kindly allowed me to share this game - I will certainly put on Twitter and YT! :-D
User avatar
6502Nerd
Pilot Officer
Posts: 111
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: dflat language update

Post by 6502Nerd »

iss wrote: Fri Jan 22, 2021 9:57 pm Important: Please, check before merging if as65.exe under Windows accepts '/' as include path separator instead of '\'.

Else, @6502Nerd, congrats for the language and for the high quality assembler sources!
Thank you for this port - I will check on Windows. Have you checked on Linux? **Does as65 exist on Linux, I didn't know this - or you use it under Wine?

I just saw the changes - mainly looks like the '\' going to '/' and the changes to the cpp files are mentioned.

Thank you for the kind words about the assembler source! :-D

**edit - I just looked at the as65 readme and apparently does run under Windows or Linux! I will still check it of course and need to see if the '\' vs '/' is ok.. I hope it would be based on this understanding.
Post Reply