Search found 724 matches

by ketmar
Tue May 07, 2024 2:16 pm
Forum: Programming
Topic: Bank switching issue
Replies: 38
Views: 1381

Re: Bank switching issue

it's not that draconian. even if you want to keep basic and IM1, it is enough to properly set BANKM ($5B5C) system variable, and don't have the stack after $C000 (with CLEAR 49151, for example). now you only have to disable interrupts while doing bank switching and updating BANKM, and you can have a...
by ketmar
Mon May 06, 2024 1:33 pm
Forum: Games/Software
Topic: The best exclusive game from a recognised brand on a YS/Crash/SU covertape: vote
Replies: 10
Views: 188

Re: The best exclusive game from a recognised brand on a YS/Crash/SU covertape: vote

i should add that Soldier One is a nice game too. could be much better if they'd simply throw away vertical scrolling, and add some colors. i'd rather have some attr clash instead of boring monochrome playfield.
by ketmar
Mon May 06, 2024 2:52 am
Forum: Games/Software
Topic: The best exclusive game from a recognised brand on a YS/Crash/SU covertape: vote
Replies: 10
Views: 188

Re: The best exclusive game from a recognised brand on a YS/Crash/SU covertape: vote

there is no reason to pretend that Batty will not win, so i will simply do the obvious thing, and choose Batty…
by ketmar
Mon May 06, 2024 2:46 am
Forum: Games/Software
Topic: Hidden code in Brainstorm game
Replies: 5
Views: 337

Re: Hidden code in Brainstorm game

then finished up writing stuff for Firebird and cover tapes. for me, it looks like "going indie", with some strange game ideas nobody wanted to sell full-price. i now think that "a whole new ball game" is really fun, but i wouldn't pay for it back in the day. it also looks like ...
by ketmar
Mon May 06, 2024 2:30 am
Forum: Emulators
Topic: Enhanced ZX Speccy (Alike system?)
Replies: 9
Views: 346

Re: Enhanced ZX Speccy (Alike system?)

one of the funniest things in "retro-programming" is working with the machine limitations in mind, i believe. otherwise we could simply write software for modern computers, and don't bother with attr clashes, counting ticks, and so on. using cross-development systems is not a cheat, though...
by ketmar
Tue Apr 30, 2024 10:38 pm
Forum: Games/Software
Topic: Game of the day...
Replies: 608
Views: 103217

Re: Game of the day...

AndyC wrote: Tue Apr 30, 2024 10:36 pm Wait. Isn't that how people do it in MM already?
i am usually jumping over it from the conveyor belt. i think it's more fun this way. and i used to do it from my first MM playthrough too… ;-)
by ketmar
Tue Apr 30, 2024 9:17 pm
Forum: Games/Software
Topic: Game of the day...
Replies: 608
Views: 103217

Re: Game of the day...

Hehe. If the telephone is the problem, you have to jump from on top of the brick wall. You can't get over it from the same height. this. i tried, and tried, and tried. that's if i even get there, because jumping onto the central platform is hard too. i realised than my MM skills are doing the bad s...
by ketmar
Tue Apr 30, 2024 8:30 pm
Forum: Games/Software
Topic: Game of the day...
Replies: 608
Views: 103217

Re: Game of the day...

i tried to complete the first room, and gave up after 15 minutes. i'd better go beat some spanish games. with my eyes closed. should be easier.
by ketmar
Tue Apr 30, 2024 9:08 am
Forum: Showcase your work!
Topic: F8 Forth cross-compiler; featuring Succubus, native Z80 code writer
Replies: 2
Views: 188

Re: F8 Forth cross-compiler; featuring Succubus, native Z80 code writer

yeah, that's why i said that M4Forth does better code. because it does. ;-) the huge problem is that it is impossible to program in Forth either without interactive REPL, or without very fast turnaround times. we don' need a debugger because we debugging our code as we're writting it. ;-) you're wri...
by ketmar
Mon Apr 29, 2024 9:15 am
Forum: Showcase your work!
Topic: F8 Forth cross-compiler; featuring Succubus, native Z80 code writer
Replies: 2
Views: 188

F8 Forth cross-compiler; featuring Succubus, native Z80 code writer

THIS IS ANNOUNCE THREAD! the system exists, and it is working, but not public yet. i simply couldn't keep it to myself anymore. ;-) so, in the good old tradition of making posts about projects i'll never finish, here is yet another one! F8 Forth cross-compiler, featuring Succubus, native Z80 code w...
by ketmar
Mon Apr 29, 2024 8:42 am
Forum: Showcase your work!
Topic: Abersoft fig-Forth Recompiled
Replies: 109
Views: 3348

Re: Abersoft fig-Forth Recompiled

i just thought that while i'm trying to write the documentation (and it may take ages), i could upload the current working source code. src and +3DOS .dsk . there is the prebuilt disk image (tap/aforth.dsk), with sprite editor and autoboot. type "EE" to run the editor. bonus: type "XI...
by ketmar
Fri Apr 26, 2024 7:46 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

i tried similar tricks, trying to avoid branches… until i remembered that it's not x86. ;-)
by ketmar
Thu Apr 25, 2024 9:58 pm
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

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 but than it is slower than 24ts case. 4*5+10=30. might be useful if HL cannot be destroyed, though. but then we have 18/32 version, which is not much slower, and sometimes faster. still, might be useful for stable timings.
by ketmar
Thu Apr 25, 2024 2:10 pm
Forum: Games/Software
Topic: Coincidence!
Replies: 65
Views: 1811

Re: Coincidence!

Lee P wrote: Thu Apr 25, 2024 2:07 pm I assume CGC entries don't count?
it would be too easy, i believe.

but you reminded me that i wanted to steal Starquake hero sprite! thank you! ;-)
by ketmar
Thu Apr 25, 2024 2:04 pm
Forum: Games/Software
Topic: Coincidence!
Replies: 65
Views: 1811

Re: Coincidence!

Bingo! https://spectrumcomputing.co.uk/SCRtoImage.php?SCR=pub/sinclair/screens/load/t/scr/Trantor-TheLastStormtrooper.scr&border=0 https://spectrumcomputing.co.uk/SCRtoImage.php?SCR=pub/sinclair/screens/load/o/scr/OurLife3.scr&border=0 https://spectrumcomputing.co.uk/SCRtoImage.php?SCR=pub/...
by ketmar
Thu Apr 25, 2024 1:17 pm
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

Here's another one: ld a, h add a jr c LE_0 or l jr z LE_0 which is 31T for Zero, 20T for negative numbers (50% of all cases) and 26T for the positive numbers. Average should be 23T, depending on how your cases are distributed. nice one! sadly, the compiler cannot use "JRs". but i'll save...
by ketmar
Thu Apr 25, 2024 1:13 pm
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

Antonio Luque wrote: Thu Apr 25, 2024 12:36 pm This takes 26ts, but preserve HL:

Code: Select all

xor a
sub l
sbc a,a
sub h
jp m,GreaterThan0
sadly, this doesn't work with $8000. that pesky $8000 again! ;-)
by ketmar
Thu Apr 25, 2024 1:03 pm
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

yet 16-bit ADD sets only carry flag. and for ADC/SBC you need another free 16-bit register, and they are slower (and you need to reset carry too). even if you have enough free registers, it will be slow. and there is no "CP HL, r16" instruction for non-destructive 16-bit comparisons. so i ...
by ketmar
Thu Apr 25, 2024 10:09 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

…and i just found another two missing instructions in Z80: "jump if both sign and zero flags are not set", and "jump if either sign, or z flag is set". ;-) so, Z80 is missing 3 useful instructions: "EX SP, SPx", and two jumps. i really have to fix my time machine!
by ketmar
Thu Apr 25, 2024 9:39 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

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. that's what i did first, just in a slightly different order. ld a, h or a j...
by ketmar
Thu Apr 25, 2024 8:23 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

_dw wrote: Thu Apr 25, 2024 7:45 am It is best to check it in M4. .))
no wai. i can read Forth, but M4 is far beyond my cognitive abilities. ;-)
by ketmar
Thu Apr 25, 2024 7:37 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

Actually, this is still the easy part. Complexity starts to increase with 32-bit numbers. that's why i'm not even planning to support 32-bit numbers natively. if you need 32-bit math in your game, you're doing something wrong. ;-) even 3d engines are ok with 16-bit math. and F8 is designed to write...
by ketmar
Thu Apr 25, 2024 7:29 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

Re: jump if signed 16-bit number is >0, <=0, fastest code

You should download the M4 Forth and test a piece of code in it in the console. oh. thank you again! i tried to invent something to "fix" zero, but my brain is not as good as it was, so i overcomplicated everything. and trying to read M4 code makes my brain hurts even more. ;-) tbh, i for...
by ketmar
Thu Apr 25, 2024 5:40 am
Forum: Programming
Topic: jump if signed 16-bit number is >0, <=0, fastest code
Replies: 34
Views: 618

jump if signed 16-bit number is >0, <=0, fastest code

i need to check if signed 16-bit number (in some register, of course) is >0, and perform a conditional jump. the same for <=0. of course, it can be solved with two JPs (that's what i did), but i maybe i missed some smart trick? ah, i forgot to tell that register contents could be destroyed (and accu...
by ketmar
Wed Apr 24, 2024 4:49 pm
Forum: Games/Software
Topic: Coincidence!
Replies: 65
Views: 1811

Re: Coincidence!