Gamecoding in machinecode on a ZX81.
Re: Gamecoding in machinecode on a ZX81.
upkey loops until no key is pressed
nokey loops as long no key is pressed
nokey loops as long no key is pressed
Re: Gamecoding in machinecode on a ZX81.
So we use both routines together in the code?
Re: Gamecoding in machinecode on a ZX81.
Thank you!
Re: Gamecoding in machinecode on a ZX81.
I don't know if it has already been mentioned. I haven't read the whole thread yet.
I have to put the screen label here for it to work
I get an error when trying to compile this change. Label not found: screendr beep wrote: ↑Sun Jan 31, 2021 4:25 pmCode: Select all
gamecode ld a,63 showa ld (screen),a dec a jr nz,showa jr gamecode
I have to put the screen label here for it to work
Code: Select all
screen
block 20,128 ; BLOCK places 20x character 128,inverted space
db 118
Re: Gamecoding in machinecode on a ZX81.
Hello! Thank you for this tutorial. I have worked through it, and it is perfect for my style of learning (I learn best by just jumping in, and looking up stuff as I go).
I have a question in terms of reusing this template for other game projects below.
The comments say that I can use #4000 to #400B for variables, but the org starts at #4009. Would I start it at #4000 if I wanted to make use of that RAM?
Would I leave the rest of this snippet alone for my own game? I assume I could at least use the two bytes with the mem label after initialization?
Also, is there anything else I should keep in mind when modifying this template for my own use?
Thanks again for this tutorial!
I have a question in terms of reusing this template for other game projects below.
Code: Select all
; 12 bytes from #4000 to #400B free reuseble for own "variables"
org #4009
; in LOWRES more sysvar are used, but in this way the shortest code
; over sysvar to start machinecode. This saves 11 bytes of BASIC
; DO NOT CHANGE AFTER BASIC+3 (=DFILE)
basic ld h,dfile/256 ; highbyte of dfile
jr init1
db 236 ; BASIC over DFILE data
db 212,28
db 126,143,0,18
eline dw last
chadd dw last-1
db 0,0,0,0,0,0 ; x
berg db 0 ; x
mem db 0,0 ; x OVERWRITTEN ON LOAD
Would I leave the rest of this snippet alone for my own game? I assume I could at least use the two bytes with the mem label after initialization?
Also, is there anything else I should keep in mind when modifying this template for my own use?
Thanks again for this tutorial!
Re: Gamecoding in machinecode on a ZX81.
The code always loads at #4009 so you need to start at #4009.Karl_G wrote: ↑Sun Apr 28, 2024 6:05 pm
The comments say that I can use #4000 to #400B for variables, but the org starts at #4009. Would I start it at #4000 if I wanted to make use of that RAM?
Would I leave the rest of this snippet alone for my own game? I assume I could at least use the two bytes with the mem label after initialization?
Also, is there anything else I should keep in mind when modifying this template for my own use?
Thanks again for this tutorial!
You can use in your code the memory before #4009 to keep variables or so needed in the code.
My current program uses #4000 to store info who was first to place a guest on a table in a bar, computer or player
Re: Gamecoding in machinecode on a ZX81.
Know that DrBeep has just published all this knowledge in his new book. And it is very cheap indeed.
The ultimate 1K coding book: How to fully use the 1K ZX81 https://amzn.eu/d/cPnqyX1
Re: Gamecoding in machinecode on a ZX81.
Thanks! Ordered!mrtinb wrote: ↑Mon Apr 29, 2024 2:29 am Know that DrBeep has just published all this knowledge in his new book. And it is very cheap indeed.
The ultimate 1K coding book: How to fully use the 1K ZX81 https://amzn.eu/d/cPnqyX1