Search found 500 matches
- Fri Apr 26, 2024 7:27 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
Re: jump if signed 16-bit number is >0, <=0, fastest code
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? Argh - right, this is not working with positive high-bytes... too bad. :| Id...
- Thu Apr 25, 2024 10:13 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
Re: jump if signed 16-bit number is >0, <=0, fastest code
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. Yes, and maybe A is already 0 from a previous operation which would allow us...
- Thu Apr 25, 2024 9:19 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
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
This could be fixed by:
Code: Select all
xor a
sub l
sbc a,a
cpl
or h
jp m,LessOrEqual0
- Thu Apr 25, 2024 3:12 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
Re: jump if signed 16-bit number is >0, <=0, fastest code
Yet another one:
Average would be something along 23.05 T.
Code: Select all
ld a, h
add a
jp c LE_0
jp nz GT_0
; deal with cases 0..255 here
or l
jp z LE_0
- Thu Apr 25, 2024 1:12 pm
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
Re: jump if signed 16-bit number is >0, <=0, fastest code
Here's another one:
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.
Code: Select all
ld a, h
add a
jr c LE_0
or l
jr z LE_0
Average should be 23T, depending on how your cases are distributed.
- Thu Apr 25, 2024 9:34 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
- Thu Apr 25, 2024 9:06 am
- Forum: Programming
- Topic: jump if signed 16-bit number is >0, <=0, fastest code
- Replies: 34
- Views: 474
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 -
and add an INC HL before jumping if you need the original value.
Code: Select all
ld a h
dec hl
or h
jp m LE_0
- Tue Apr 23, 2024 8:53 pm
- Forum: ZXDB Fixes
- Topic: HELP WANTED: Magazine type-in page numbers!
- Replies: 17
- Views: 320
Re: HELP WANTED: Magazine type-in page numbers!
Music Entertainer - Homecomputer 1984/12 p 35
Can't verify though as no PDF for that issue is available.
Loading screen from the TZX:
Can't verify though as no PDF for that issue is available.
Loading screen from the TZX:
- Tue Apr 23, 2024 7:52 pm
- Forum: ZXDB Fixes
- Topic: HELP WANTED: Magazine type-in page numbers!
- Replies: 17
- Views: 320
Re: HELP WANTED: Magazine type-in page numbers!
Ops, this magazine was duplicated by mistake! This is the correct link, including these type-ins: https://spectrumcomputing.co.uk/issue/10463/Happy_Computer/1 EDIT: It seems Happy Computer was originally called "Hobby Computer" in the first issue only. ok I've found the issue number for 8...
- Tue Apr 23, 2024 5:49 pm
- Forum: ZXDB Fixes
- Topic: HELP WANTED: Magazine type-in page numbers!
- Replies: 17
- Views: 320
Re: HELP WANTED: Magazine type-in page numbers!
PS: Regarding German titles, do you know where to find these? https://spectrumcomputing.co.uk/list?group_id=1055&lang=german No idea. I've found a full scan of Hobby-Computer 1983/11 in my download folder, it's not in your database. https://drive.google.com/file/d/11E_W1lePVps-d3Y1B8Tp13nJOOMWB...
- Tue Apr 23, 2024 4:09 pm
- Forum: ZXDB Fixes
- Topic: HELP WANTED: Magazine type-in page numbers!
- Replies: 17
- Views: 320
Re: HELP WANTED: Magazine type-in page numbers!
Please mark it as starting at page 17. That's not exactly accurate, but it's the only page reference we have. done Hupschraubär Pilot - Happy-Computer 84/11 p 74 Manic Train - Computer Kontakt 85/03 p 29 Mensch ärgere Dich nicht - Happy-Computer 84/09 p 40 I see that Neil Parsons already did Hunter...
- Tue Apr 23, 2024 1:36 pm
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 7898
- Views: 239333
- Tue Apr 23, 2024 8:19 am
- Forum: ZXDB Fixes
- Topic: HELP WANTED: Magazine type-in page numbers!
- Replies: 17
- Views: 320
Re: HELP WANTED: Magazine type-in page numbers!
Graphik - Heim-Computer 1983/11 p 40 (40 in pdf) Hinterhalt - Heim-Computer 1983/12 p 43 (47 in pdf) Tischdecken - Happy-Computer 1984/07 p 57 (55 in pdf) Der Sagenhafte Schatz des Drachen Mordor: The listing appears to be on a large poster (inside the issue), so no page number. Also, there's no PDF...
- Tue Apr 23, 2024 7:55 am
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 7898
- Views: 239333
- Mon Apr 22, 2024 6:23 pm
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 7898
- Views: 239333
Re: Guess the screen$
not Klax
The game had several big reviews and wasn't mentioned in this thread so far.
The game had several big reviews and wasn't mentioned in this thread so far.
- Mon Apr 22, 2024 3:31 pm
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 7898
- Views: 239333
- Mon Apr 22, 2024 3:03 pm
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 7898
- Views: 239333
- Mon Apr 22, 2024 2:38 pm
- Forum: Games/Software
- Topic: Guess the screen$
- Replies: 7898
- Views: 239333
- Sat Apr 20, 2024 3:51 pm
- Forum: Sinclair Miscellaneous
- Topic: RIP F David Thorpe
- Replies: 31
- Views: 1481
Re: RIP F David Thorpe
My Speccy came bundled with Pogo. It reminded me of the drawings by M.C.Escher that we were talking about in the school in arts.
The game took more than 5 minutes to load which was embarassing as it subsequently crashed (turned out my board had an error and needed replacement).
The game took more than 5 minutes to load which was embarassing as it subsequently crashed (turned out my board had an error and needed replacement).
- Fri Apr 12, 2024 7:12 am
- Forum: Programming
- Topic: BASin - How to load code from assembler?
- Replies: 4
- Views: 223
Re: BASin - How to load code from assembler?
Thank you for commenting Joefish and Timmy . Here's my hacky solution to get a file loaded from code: Set up a 34-byte area with the following data: [0] 3 - this byte tells we're requesting a CODE/SCREEN$ file [1..10] - the name of our file, padded with blanks if less than 10 chars [11..12] - reques...
- Wed Apr 10, 2024 12:39 pm
- Forum: Programming
- Topic: BASin - How to load code from assembler?
- Replies: 4
- Views: 223
Re: BASin - How to load code from assembler?
There's a 2nd trap in the ROM at $63a (1594), this is where the file name is taken from by BASin for the next LD_BYTES call.
Am I supposed to call this trap from assembler? It's a bit clumsy to mock all up.
Am I supposed to call this trap from assembler? It's a bit clumsy to mock all up.
- Wed Apr 10, 2024 10:40 am
- Forum: Programming
- Topic: BASin - How to load code from assembler?
- Replies: 4
- Views: 223
BASin - How to load code from assembler?
I'm trying to load a code block from my assembler routine without the print output to the screen. So I've prepared the 17-byte header in IX and called LD_BYTES at ROM $556. Behind that header I reserved the usual 17-byte space for the header to be received. Address $556 is being trapped by BASin/Bas...
- Sat Apr 06, 2024 5:35 am
- Forum: Other Retro Stuff
- Topic: Lara Croft voted most iconic character ever
- Replies: 42
- Views: 960
- Fri Apr 05, 2024 9:02 pm
- Forum: Programming
- Topic: Euclidean dist/Sqrt/Multiplication routines 16bit
- Replies: 38
- Views: 904
Re: Euclidean dist/Sqrt/Multiplication routines 16bit
Could you calculate the square root less often or not at all if you used a different admissible heuristic function? You could presumably use something which is faster to calculate but which meets the criterion of never overestimating the cost of reaching the goal? If the estimation is too far off y...
- Wed Apr 03, 2024 10:54 pm
- Forum: Programming
- Topic: Euclidean dist/Sqrt/Multiplication routines 16bit
- Replies: 38
- Views: 904
Re: Euclidean dist/Sqrt/Multiplication routines 16bit
A hacky way of getting this distance between two 2d points is this determine largest and smallest values from x,y length = largest + (smallest>>1) gives a worst case 12% error if smallest >= (largest>>3) then length = largest + (smallest>>1) - (largest>>3) gives worst case ~6% error but mostly <2% ...