Search found 105 matches
- Mon May 13, 2024 3:45 am
- Forum: Emulators
- Topic: Questions about gamedev in an emulator...
- Replies: 22
- Views: 378
Re: Questions about gamedev in an emulator...
The main thing was that my belief that ASM == BIN simply does not apply 100%.
- Mon May 13, 2024 3:40 am
- Forum: Emulators
- Topic: Questions about gamedev in an emulator...
- Replies: 22
- Views: 378
Re: Questions about gamedev in an emulator...
That's more to do with coprocessors and pipelining and stuff though which the Z80 does not do. Nowadays with pipelining, branch prediction, caches and coprocessors it's way too hard to translate instructions into execution time and the compiler is usually better than humans at it anyway. None of th...
- Mon May 13, 2024 3:29 am
- Forum: Emulators
- Topic: Questions about gamedev in an emulator...
- Replies: 22
- Views: 378
Re: Questions about gamedev in an emulator...
That's one of the big advantages of coding in ASM really what you see in the debugger is exactly what you wrote. There is certainly at least one exception to this. When I was interested in the Intel 8087 math coprocessor, I was very confused by the source I found where to insert the FWAIT instructi...
- Sun May 12, 2024 11:34 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Tom Odell: Another Love - another version (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
Download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... _love2.tap
Download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... _love2.tap
- Fri May 10, 2024 4:31 am
- Forum: Games/Software
- Topic: Why didn't the Spectrum have an FPS?
- Replies: 33
- Views: 914
- Fri May 10, 2024 3:41 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Bradley Ira Fiedel: Terminator 2 theme (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
https://youtu.be/tSWrDnY0-Vk
download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... nator2.tap
https://youtu.be/tSWrDnY0-Vk
download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... nator2.tap
- Wed May 08, 2024 5:57 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Hans Zimmer: Cornfield Chase (Interstellar) (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
https://youtu.be/jGd53Whi3-w
download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... tellar.tap
https://youtu.be/jGd53Whi3-w
download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... tellar.tap
- Tue May 07, 2024 2:58 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
いきものがかり: Naruto - Blue Bird (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... e_Bird.tap
download: https://codeberg.org/DW0RKiN/M4_FORTH/s ... e_Bird.tap
- Sun May 05, 2024 7:48 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Yann Pierre Tiersen: Comptine d'un autre été (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
[video][/video]
https://codeberg.org/DW0RKiN/M4_FORTH/s ... re_ete.tap
[video][/video]
https://codeberg.org/DW0RKiN/M4_FORTH/s ... re_ete.tap
- Sat May 04, 2024 7:59 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
三好 智己: I Am Setsuna - Path of Redemption (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
https://codeberg.org/DW0RKiN/M4_FORTH/s ... mption.tap
https://codeberg.org/DW0RKiN/M4_FORTH/s ... mption.tap
- Fri May 03, 2024 5:15 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Trevor Jones: Last Mohicans - Kiss (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
https://codeberg.org/DW0RKiN/M4_FORTH/s ... s_Kiss.tap
https://codeberg.org/DW0RKiN/M4_FORTH/s ... s_Kiss.tap
- Wed May 01, 2024 8:37 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Kai Rosenkranz: Gothic 3 - Vista point (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered))
https://codeberg.org/DW0RKiN/M4_FORTH/s ... _point.tap
https://codeberg.org/DW0RKiN/M4_FORTH/s ... _point.tap
- Tue Apr 30, 2024 1:41 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
I think that the Bad Apple for the 48 version did not exist yet. 太田 "ZUN" 順也: Bad Apple!! (ZX Spectrum 1 bit beeper cover (Fuse Unfiltered)) https://youtu.be/EUzOJEWme-Y https://codeberg.org/DW0RKiN/M4_FORTH/src/branch/master/Testing/Bad_Apple.tap (this tap has modified sound at the end an...
- Tue Apr 30, 2024 1:29 am
- Forum: Music
- Topic: ZX Spectrum 48 beeper music colection
- Replies: 30
- Views: 2667
Re: ZX Spectrum 48 beeper music colection
Below I am drawing a picture of 3 square waves. Their frequency is the same, but the phase is different. ___---___--- _---___---__ ---___---___ Does this make sense? I thought so. However, I just checked the code again and it seems that phase is actually reset. So, the answer is no. Best forget eve...
- Tue Apr 30, 2024 1:14 am
- Forum: Showcase your work!
- Topic: F8 Forth cross-compiler; featuring Succubus, native Z80 code writer
- Replies: 3
- Views: 234
Re: F8 Forth cross-compiler; featuring Succubus, native Z80 code writer
In fact, in the worst case scenario, compiling with M4 Forth can take hours. Translation(edit:compile) speed was never a priority, only the final product. In certain cases when the best solution is found and by searching the state space, M4 Forth simply starts doing it. And he doesn't care about the...
- Thu Apr 25, 2024 11:15 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
So I should improve the code in the case of "DUP 0 LE IF". ld A, H ; 1:4 add A, A ; 1:4 jr c, $+6 ; 2:7/12 or L ; 1:4 jr nz, LAB_GT ; 3:10 ; LAB_LE: ; ... LAB_GT: ;[8:20,29/29] price 56.5 old code dnl dnl dnl # ( x1 -- x1 ) dnl # dup 0<= if define({DUP_0LE_IF},{dnl __{}__ADD_TOKEN({__TOKEN...
- Thu Apr 25, 2024 10:49 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
Save TopOfStack code dworkin@dw-A15:~/Programovani/ZX/Forth/Pasmo_test$ ../check_word.sh 'DUP PUSH(0) GT IF' ;[7:30] dup 0 > if ( x -- x ) flag: x > 0 ld A, H ; 1:4 dup 0 > if save sign dec HL ; 1:6 dup 0 > if zero to negative or H ; 1:4 dup 0 > if inc HL ; 1:6 dup 0 > if jp m, else101 ; 3:10 dup 0 ...
- Thu Apr 25, 2024 10:40 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
This could be fixed by: xor a sub l sbc a,a cpl or h jp m,LessOrEqual0 test HL = 0x3300 xor A --> a == 0 sub L --> 0x00 - 0x00 --> not carry sbc A,A --> A = 0x00 cpl --> A = 0xFF or H --> fail, because H does not depend and the result will be less than or equal to 0 Do I understand correctly?
- Thu Apr 25, 2024 11:29 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
I'm sure that 40 years ago the creators of the Z80 (8080?) had it well thought out. It was just forgotten along the way. When you write in assembler, you don't choose a signed number, but you have something easier for a loop. The best ending in zero. Just adjust the problem to something easier. If y...
- Thu Apr 25, 2024 11:15 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
There is an overflow attribute for signed arithmetic. I ignored PO and PE for a long time before I realized how to use it. And how does the credit actually work at all. It is best to read the "Z80 Family CPU User Manual.pdf" directly. Most sites deal only with carry and zero flag. At the s...
- Thu Apr 25, 2024 9:48 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
that's what i did first, just in a slightly different order. ld a, h or a jp m, # skip or l jp nz, # dest skip: somewhat faster than checking for 0 first. it is faster for negative numbers (18ts), but slower for 0 (32ts). and if programmer wrote such check, they prolly expect to see 0 quite often. ...
- Thu Apr 25, 2024 9:41 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
I suspect the easiest way is to check for 0 first, by just ORing the bytes and checking the Z flag. Assuming it's not 0, it's just a single bit test of the relevant sign bit. Should be easily adapted to any size of integer. Whether it's the fastest sort of depends on how you're measuring it, since ...
- Thu Apr 25, 2024 9:28 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
Maybe if you take the upper part after a DEC and check for bit 7? Something like posted by @_dw above - ld a h dec hl or h jp m LE_0 or dec hl bit 7,h and add an INC HL before jumping if you need the original value. And if you know from the previous operation that A has bit 7 unset you can spare th...
- Thu Apr 25, 2024 9:19 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
no wai. i can read Forth, but M4 is far beyond my cognitive abilities. ;-) Ah, that's what you meant. I don't expect anyone to understand the M4 source code. (Even if it's not that impossible, it just takes a little practice, most of the code is primitive) I meant that you look at what the assemble...
- Thu Apr 25, 2024 7:45 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 669
Re: jump if signed 16-bit number is >0, <=0, fastest code
The completely basic variant is quite easy even for an interpreter. Divide the constants into two sets. The first 0 .. 0x7FFF is close to the number 0x8000 when adding a positive constant smaller than 0x8000 (that constant must be smaller than 0x8000). According to the result, you will know whether ...