Forum Replies Created
-
AuthorReplies
-
::
Hi,
Org 6000h
WPTCHAR EQU $3CDF
ld a,’A’
DEFW WPTCHAR
retthis uses the newbrain OS to print a char on the screen
if you want to print at a specified location use this
Org 6000h
WPTCHAR EQU $3CDF
ld a,22
DEFW WPTCHAR
ld a,10 ;X = Column
DEFW WPTCHAR
ld a,15 ; Y= Row
DEFW WPTCHARld a,’A’
DEFW WPTCHAR
retUsefull screen codes
22,x,y
31 ;Clear screen
For built in assembler write the code to source. Click Compile then next to this button the RAM button will put the object code to ram. Next call 24576 to run.
if you click put object in file then a file names <youfilename>.txt will be created that will have the basic code to run the code like this
10 Reserve top-24576
20 For i=0 to 16
30 Read a:poke 24576+i,a
40 next i
50 ?”type CALL TOP to run your code.”
100 END
10000 DATA 62,22,223,60,62,10,223,60,62,15also a <filename>.blst like this
5) 6000 3E 16 ld a,22 ;
6) 6002 DF 3C DEFW WPTCHAR ;
7) 6004 3E 0A ld a,10 ;
8) 6006 DF 3C DEFW WPTCHAR ;
9) 6008 3E 0F ld a,15 ;
10) 600A DF 3C DEFW WPTCHAR ;
12) 600C 3E 41 ld a,’A’ ;
13) 600E DF 3C DEFW WPTCHAR ;
14) 6010 C9 ret ;and ofcourse the <filename>.bin that have the raw bytes.
The <filename>.GSYM contains the global symbols if you declared any, so you can include it to another source file if you want.
you can declare globals at the start of the source file usually for projects
GLOBAL <name>
GLOBAL test
test equ 45 or
test: xor a
ret
OR
@test equ 45
@test: xor a::You are right that was all wrong.
Well here are the keywords i found from the binary
AFTER ASSEMBLE IS FINISHED PRESSING A KEY SAVES THE BINARY FILE TO UNKNOWNx.BIN ON THE TAPE DIRECTORY
ASSEMBLE COMPILES THE SOURCE
LOAD LOADS THE SOURCE FILE (SELECT THE FILE TO LOAD FIRST)
SAVE SAVES THE SOURCE TO UNKNOWNx.BAS
DEL <LINENO> DELETES A LINE
LIST
NEW CLEARS THE CURRENT PROGRAM
OLD REINSTATES THE OLD PROGRAM USE AFTER NEW
PLIST LISTS TO THE PRINTER ANSWER Y ON START (ON THE EMULATOR THAT IS PRINTERNEW.PRN)
REN <NUMBER> IT RENUMBERS ALL COMMANDS FROM NUMBER (10 IS THE SPACING)
MEMORY SHOWS FREE MEMORY
DLOAD NOT WORKING ON TAPE (DISK)
DSAVE NOT WORKING ON TAPE (DISK)
RUN LOADS FROM TAPE BUT WHAT
MAN CRASHES-
This reply was modified 1 week, 2 days ago by
CDesp.
::Hi,
you can use the built in assembler of the emulator to put the code straight to memory.
That is good for testing and fast development.
For Newbas from what i remember you have to save the object file to disk or tape and then make a small
basic loader to put the bytes to memory.
Something like this ( i am doing this from memory so some mistakes my exist):
tape must be at the start of the file, usually the loader precedes the object file, filename is optional
10 Openin#1,1,”Filename.o”
15 k=16384:n=<your filesize>
20 for i=1 to n
30 get#1,a:poke k,a:k=k+1
40 next i
45 close#1
50 call 16384: Rem if you want to execute the code
100 endfor disk change line 10 to
10 openin#9,9,”filename.o”
filename is required::VFD on
Run 1 elapsed 6.98
Run 2 elapsed 7.06
Run 3 elapsed 7.14
Run 4 elapsed 7.2
Run 5 elapsed 6.4 (after put 31 that clears the screen)
So it depends of how many chars the screen is showing. That is the busrq/busack. if a line has a1 char then the video circuit enables the cpu after that char, it does not wait for the line to end.
with put 31:run elapsed 6.38 every time no chars on screen
with vfd off the same results so the only the chars on the screen affects the result.
with list (so the listing is displayed) i get 7.3 secs::Nice work.
Newbrain uses busreq/busack to paint the screen so the real speed is a lot less than 4MHz.
That is the reason if you play chess with the fast setting on it disables the screen to go full speed.
So for some games like the crossing the speed should be reduced otherwise it is almost unplayable.
::Great implementation.
Tape files with binary follow ups should automatically change to the next file after each file loads. Like Pacman.bas, it needs to load the pac.screen.bin and the pac.bytes.bin. So it should probably go to a seperate folder and somehow put the files in order, or use a container like .tap.
There are also .bas files that are disk files (cp/m) like demo30.bas. this one loads(merge) other bas files depending on the menu you choose, so it needs the cp/m, either the small one or the full with the Expansion. In my fpga i use a new 8K rom on bank 4 that implements a new device 12,13,14,15 (like cp/m) that loads from the sdcard.
Newbrain uses all devices the same way as streams so you can replace any device with another.
If you need help with the cp/m let me know.
::Hi,
you can try the attached patterns (just overwrite the contents of the folder). They are the same as the mame wave.
But be aware you cannot convert a non TAPE file to a wav file. The file you are converting should be a tape file not a disk one.
If you want to convert a disk file you can do it by loading it on the newbrain and then poke 19,1 and save it as tape. That will produce a tape file which then you can convert it to a wave file to be written to a real tape and then be read by a real newbrain.
Anyway if that doesn’t work i ll have to build me a cable and do some tests.
Attachments:
::Ok i made a tool to do this. I have not tested it.
So here it is https://newbrainemu.eu/download/bin2wave/.
-
This reply was modified 1 week, 2 days ago by
-
AuthorReplies