### Assembly Example Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Example of assembly code with comments explaining instructions. ```assembly 3E C8 ; 3E / 62 means LD A and C8 = 200 in Hexadecimal C9 ; C9 / 201 is a return instruction ``` -------------------------------- ### Running a Program Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Commands to run an assembled program from the command prompt. ```bash S FIRST.SPE ``` -------------------------------- ### Loading TAP File (NextZXOS) Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Commands to load a TAP file and then load code from it using NextZXOS. ```bash CLEAR 49151 .tapein PROJECT1.TAP LOAD "t:" LOAD "name" CODE 49152 .tapein -c ``` -------------------------------- ### Reading and Poking Data into Memory in BASIC Source: https://github.com/chernandezba/zesarux/blob/main/src/tests/testing_mmu2.txt This snippet demonstrates reading data and 'poking' it into a range of memory addresses. It prints each address and its corresponding value. ```BASIC 30 for n=23296 to 23551: read a: poke n,a: print n,a: next n ``` -------------------------------- ### Standard File Selection Dialog Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This is the standard implementation for a file selection dialog, used when not on MorphOS. It includes logic for navigating directories and handling user input. ```c #else //En el caso de stdout es mucho mas simple if (!strcmp(scr_driver_name,"stdout")) { printf ("%s :\n",titulo); for (int i=0; filtros[i]!=NULL; i++) { printf ("%s\n", filtros[i]); } printf ("\n%s : ", archivo); char buffer[200]; gets(buffer); strcpy(archivo, buffer); return 1; } //Si no se ha pulsado ninguna tecla, se dice el directorio activo //menu_active_item_primera_vez=1; //Decir directorio activo menu_textspeech_say_current_directory(); do { menu_speech_tecla_pulsada=0; menu_active_item_primera_vez=1; //Se dice el directorio activo menu_textspeech_say_current_directory(); //Se dibuja el menu menu_draw_menu(titulo, filtros, archivo, menu_active_item, menu_active_item_primera_vez); //Se espera a que se pulse una tecla menu_espera_no_tecla(); //Se lee la tecla pulsada menu_speech_tecla_pulsada=menu_readkey(); //Si se pulsa ESC, se sale if (menu_speech_tecla_pulsada==27) { //Se sale del menu return 0; } //Si se pulsa ENTER, se selecciona el item else if (menu_speech_tecla_pulsada==13) { //Si se ha seleccionado archivo, se sale if (menu_select_item(titulo, filtros, archivo, menu_active_item)) return 1; } //Si se pulsa flecha arriba, se decrementa el item activo else if (menu_speech_tecla_pulsada==259) { menu_active_item--; if (menu_active_item<0) menu_active_item=menu_num_items-1; } //Si se pulsa flecha abajo, se incrementa el item activo else if (menu_speech_tecla_pulsada==257) { menu_active_item++; if (menu_active_item>=menu_num_items) menu_active_item=0; } //Si se pulsa flecha derecha, se entra en el directorio else if (menu_speech_tecla_pulsada==261) { //Si se ha seleccionado archivo, se sale if (menu_select_item(titulo, filtros, archivo, menu_active_item)) return 1; } //Si se pulsa flecha izquierda, se sale del directorio else if (menu_speech_tecla_pulsada==260) { //Se sale del directorio char *ultimo_slash; ultimo_slash=strrchr(menu_filesel_last_directory_seen,'/'); if (ultimo_slash!=NULL) *ultimo_slash=0; else menu_filesel_last_directory_seen[0]=0; //Se dice el directorio activo //Esperar a liberar tecla si no la tecla invalida el speech menu_espera_no_tecla(); menu_textspeech_say_current_directory(); } //Si se pulsa una tecla cualquiera, se dice el item activo else { //Se dice el directorio activo //Esperar a liberar tecla si no la tecla invalida el speech menu_espera_no_tecla(); menu_textspeech_say_current_directory(); } } while (1); //Aqui no se va a llegar nunca //cls_menu_overlay(); //menu_espera_no_tecla(); #endif ``` -------------------------------- ### Loading TAP File (ESXDOS) Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Commands to load a TAP file and then load code from it using ESXDOS. ```bash CLEAR 49151 .tapein PROJECT1.TAP LOAD "name" CODE 49152 .tapein -c ``` -------------------------------- ### Initialize and Map MMU Segments Source: https://github.com/chernandezba/zesarux/blob/main/src/tests/testing_mmu.txt Sets up the MMU by clearing memory, disabling interrupts, and copying ROM data to a specific memory address. It then configures MMU segments to map RAM onto ROM space. ```BASIC 10 clear 49151 20 out 32765,16 30 for n=23296 to 23551: read a: poke n,a: print n,a: next n 40 data 33,0,0,17,0,192,1,0,64,237,176,201 ``` -------------------------------- ### Sample Assembly Program Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt This is a sample assembly program to be typed into the SPED53 editor. It sets the accumulator to 200 and then returns. ```assembly ;Sample program make A=200 LD A,200 RET ``` -------------------------------- ### Directives List Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt List of allowed directives for assembly. ```text DEFS - Define an amount of space to leave DEFM - Define a string DEFB - Define a byte DEFW - Define a word (2 Bytes) ENT - Entry address for code LST+ - listing on and off LST- ORG - Where the assembled code should be put to run it DPR+ - see note below DPR- ``` -------------------------------- ### Replace Prism ROM Header Source: https://github.com/chernandezba/zesarux/blob/main/src/prism_change_boot.txt This sequence of commands backs up the original ROM, prepends the new boot ROM, and then appends the original data. It's used to update the boot sector of a Prism ROM file. ```bash dd if=prism.rom of=prism_nuevo.rom bs=1k skip=32 cat PrismBootRom.bin > prism.rom cat PrismBootRom.bin >> prism.rom cat prism_nuevo.rom >> prism.rom rm prism_nuevo.rom ``` -------------------------------- ### Outputting Memory Values in BASIC Source: https://github.com/chernandezba/zesarux/blob/main/src/tests/testing_mmu2.txt The 'out' command is used to output a value to a specified port. ```BASIC 20 out 32765,16 ``` -------------------------------- ### Configure Rule for Coleco Object File Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Updates the `core_coleco.o` rule in the `configure` script to include `zrcp/zeng_online_client.h`. This ensures the Zeng Online client header is considered when compiling the Coleco core object file. ```makefile core_coleco.o: cores/core_coleco.c cores/core_coleco.h cpu.h debug.h storage/tape.h audio/audio.h video/screen.h soundchips/ay38912.h operaciones.h snap/snap.h timer.h zxvision.h chardetect.h compileoptions.h contend.h snap/snap_zx8081.h utils.h realjoystick.h settings.h machines/coleco.h vdp_9918a.h soundchips/sn76489an.h vdp_9918a_sms.h snap/snap_ram.h codsinpr.h zrcp/zeng_online_client.h $$(CC) $$(CFLAGS) -c cores/core_coleco.c ``` -------------------------------- ### MorphOS File Requester Implementation Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code implements a file selection dialog specifically for MorphOS using the ASL library. It handles file path selection and returns success or failure. ```c #if defined(__MORPHOS__) struct FileRequester *filereq = NULL; filereq = AllocAslRequestTags( ASL_FileRequest, ASL_Hail, "Open File", (struct TagItem *)TAG_DONE); if(AslRequestTags(filereq, ASLFR_InitialLeftEdge, 20, ASLFR_InitialTopEdge, 20, ASLFR_InitialWidth, 300, ASLFR_InitialHeight, 350, ASLFR_InitialDrawer, menu_filesel_last_directory_seen, ASLFR_InitialPattern, "(#?.tap|#?.z80|#?.sna)", ASLFR_PositiveText, "Load", ASLFR_DoPatterns, TRUE, (struct TagItem *)TAG_DONE)) { char zxfile[200]; strcpy(zxfile, (char *)filereq->rf_Dir); AddPart(zxfile, (char *)filereq->rf_File, 200); strcpy(archivo, zxfile); strcpy(menu_filesel_last_directory_seen , filereq->rf_Dir); return 1; } else { //strcpy(menu_filesel_last_directory_seen , filereq->rf_Dir); return 0; } if(filereq) FreeAslRequest(filereq); #else ``` -------------------------------- ### Add Zeng Online Client Header Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Includes the Zeng Online client header file. This is necessary for using Zeng Online client functions within the Coleco core. ```c #include "zeng_online_client.h" ``` -------------------------------- ### Saving Assembled Code (NextZXOS) Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Command to save assembled code as a block using NextZXOS. ```bash SAVE "name" CODE 49152,length ``` -------------------------------- ### Copy QL Keyboard Table Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Copies the QL keyboard table to a temporary array before potential modifications. This ensures the original state is preserved. ```c unsigned char antes_ql_keyboard_table[8]; int i; if (MACHINE_IS_QL) { for (i=0;i<8;i++) antes_ql_keyboard_table[i]=ql_keyboard_table[i]; } ``` -------------------------------- ### Return to System from BASIC Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt When exiting SPED53 to BASIC, an address is printed. Type this address using RANDOMIZE USR xxxxx to return to the system with your source code intact. ```zx-basic Return to 49453 ``` -------------------------------- ### Conditional Speech Output for Welcome and Menu Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet controls speech output for welcome and escape menu messages. It is conditionally compiled to exclude speech on MorphOS systems. ```c #if !defined(__MORPHOS__) textspeech_print_speech(texto_welcome); textspeech_print_speech(texto_esc_menu); #endif ``` -------------------------------- ### Saving Assembled Code (ESXDOS) Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Command to save assembled code as a block using ESXDOS. ```bash SAVE *"name" CODE 49152,length ``` -------------------------------- ### Saving Object Code Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt Command to save the assembled object code to a binary file. ```bash O FIRST.BIN ``` -------------------------------- ### Restore QL Keyboard Table Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Restores the QL keyboard table from a temporary array. This is typically done after modifications or during a reset. ```c if (MACHINE_IS_QL) { for (i=0;i<8;i++) ql_keyboard_table[i]=antes_ql_keyboard_table[i]; } ``` -------------------------------- ### MorphOS Specific Includes in menu.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This section includes necessary headers for MorphOS development. These are conditionally included based on the __MORPHOS__ macro. ```c #if defined(__MORPHOS__) #include #include #include #endif ``` -------------------------------- ### Clearing Memory in BASIC Source: https://github.com/chernandezba/zesarux/blob/main/src/tests/testing_mmu2.txt Use the 'clear' command to reset memory to a specified value. ```BASIC 10 clear 49151 ``` -------------------------------- ### Data for Memory Operations in BASIC Source: https://github.com/chernandezba/zesarux/blob/main/src/tests/testing_mmu2.txt Provides the data values to be read and used in memory operations. ```BASIC 40 data 33,0,0,17,0,192,1,0,64,237,176,201 ``` -------------------------------- ### Conditional Text Speech Program Argument Handling in cpu.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code block shows how the --textspeechprogram argument is handled. The entire block is conditionally compiled out for MorphOS. ```c #if !defined(__MORPHOS__) else if (!strcmp(argv[puntero_parametro],"--textspeechprogram")) { siguiente_parametro_argumento(); textspeech_filter_program=argv[puntero_parametro]; } else if (!strcmp(argv[puntero_parametro],"--textspeechprogram-filter")) { siguiente_parametro_argumento(); textspeech_filter_program_filter=argv[puntero_parametro]; } #endif ``` -------------------------------- ### Conditional Screen Dump to Speech for ZEsarUX Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code block conditionally executes the textspeech_enviar_speech_pantalla() function when the F4 key is pressed, but only if not running on MorphOS. It's used for dumping the screen content to speech output. ```c //F4 pulsado. Volcar pantalla a speech case UTIL_KEY_F4: + #if !defined(__MORPHOS__) if (pressrelease) textspeech_enviar_speech_pantalla(); + #endif break; ``` -------------------------------- ### Disassembler Monitor Commands Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped53en/readmeSPED53.txt List of commands available in the SPED53 disassembler monitor. ```text D at the Command Prompt ``` ```text EDIT/ENTER ME-+1 cursor left and right +-8 bytes Up/Down -+ Instruction C Calculate Expression $ Disassemble SS+D Read Debug Table Yes/No E Assemble instruction I Insert Bytes SS+K Execute L List Hex and Ascii M Change point in Memory SS+N Make PC = ME SS+Q Quit disassembler / monitor R Modify register RR=XXXX S See screen SS+S Configure screen destination (0:None 1:Symbols 2:Debug) SS+T Set Breakpoint after instruction SS+Z Step by Step SS+3 Numbers Hex or Dec (i.e. #) ``` -------------------------------- ### Call Zeng Online Client Function in Coleco Core Loop Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Calls a specific Zeng Online client function at the end of the Coleco core's frame loop. This is likely for synchronizing or sending data related to the core's state. ```c zeng_online_client_end_frame_from_core_functions(); ``` -------------------------------- ### Conditional Text Speech Cleanup in cpu.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This section conditionally cleans up text speech related files on Windows. The cleanup operations are excluded for MorphOS builds. ```c #if !defined(__MORPHOS__) //Borrar archivos de speech en Windows //Borrar archivo de lock textspeech_borrar_archivo_windows_lock_file(); //Borrar archivo de speech textspeech_borrar_archivo_windows_speech_file(); #endif ``` -------------------------------- ### Define Maximum Path and Name Lengths for MorphOS Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This section defines macros for PATH_MAX and NAME_MAX to be 5000 when compiling for MorphOS. This increases the maximum allowed lengths for file paths and names. ```c #if defined(__MORPHOS__) #define PATH_MAX 5000 #define NAME_MAX 5000 #endif ``` -------------------------------- ### Conditional Text Speech FIFO Handling in menu.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code conditionally handles the text speech FIFO. The call to textspeech_print_speech is wrapped in a preprocessor directive. ```c #if !defined(__MORPHOS__) textspeech_print_speech(buf_speech); #endif ``` -------------------------------- ### Conditional Text Speech FIFO Handling in chardetect.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet demonstrates conditional handling of the text speech FIFO queue. It ensures that speech FIFO operations are only performed when not compiling for MorphOS. ```c #if !defined(__MORPHOS__) textspeech_add_speech_fifo(); #endif ``` -------------------------------- ### SPED52 Command Prompt Menu Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped52en/readmeSPED52.txt This menu lists the available commands at the SPED52 command prompt. Capital letters are generally used for commands. ```text A - Assemble B - Back to Basic D - Disassembler E - Editor F - Modify Date G n - Set block of text to use I - General Information L - Load source code N - New block of Text O - Save Object Code S - Save Source Code T - View Symbol Table Z - Delete Source Code ``` -------------------------------- ### Conditional Text Speech Sending in menu.c (String Update) Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet shows a character from a string being sent to the text speech system. The text speech call is conditionally compiled. ```c sprintf (buf_speech,"%c",string[i]); #if !defined(__MORPHOS__) menu_textspeech_send_text(buf_speech); #endif ``` -------------------------------- ### Update Snapshot Block ID for Coleco Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Modifies the condition for saving the ZSF_KEY_PORTS_SPECTRUM_STATE block in snapshots. It now includes `MACHINE_IS_COLECO` to ensure keyboard port values are saved for Coleco systems. ```c if (MACHINE_IS_SPECTRUM || MACHINE_IS_ZX8081ACE || MACHINE_IS_SMS || MACHINE_IS_SG1000 || MACHINE_IS_COLECO) { ``` -------------------------------- ### Conditional Speech Output for Directory Announcement Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet ensures that the current directory is announced via speech synthesis. It is conditionally compiled to be inactive on MorphOS. ```c //Decir directorio activo //Esperar a liberar tecla si no la tecla invalida el speech menu_espera_no_tecla(); #if !defined(__MORPHOS__) menu_textspeech_say_current_directory(); #endif ``` -------------------------------- ### Conditional Text Speech Filter Execution in menu.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code conditionally executes the text speech filter if the child speech process has finished. This is specific to non-MorphOS environments. ```c #if !defined(__MORPHOS__) if (textspeech_finalizado_hijo_speech() ) scrtextspeech_filter_run_pending(); #endif ``` -------------------------------- ### Copy CPC Keyboard Table Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Copies the CPC keyboard table to a temporary array. This is done to preserve the original state before potential changes. ```c z80_byte antes_cpc_keyboard_table[16]; int i; if (MACHINE_IS_CPC) { for (i=0;i<16;i++) antes_cpc_keyboard_table[i]=cpc_keyboard_table[i]; } ``` -------------------------------- ### Restore CPC Keyboard Table Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/zeng_online_add_core.txt Restores the CPC keyboard table from a temporary array. This ensures the correct keyboard state is maintained. ```c if (MACHINE_IS_CPC) { for (i=0;i<16;i++) cpc_keyboard_table[i]=antes_cpc_keyboard_table[i]; } ``` -------------------------------- ### Conditional Text Speech Sending in menu.c (Key Press) Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code conditionally sends a pressed key character to the text speech system. The function call is guarded by a preprocessor directive. ```c sprintf (buf_speech,"%c",tecla); #if !defined(__MORPHOS__) menu_textspeech_send_text(buf_speech); #endif ``` -------------------------------- ### Conditional Speech Output for Current Directory Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This function announces the current directory via speech synthesis. It is conditionally compiled to be inactive on MorphOS. ```c #if !defined(__MORPHOS__) menu_textspeech_say_current_directory(); #endif ``` -------------------------------- ### Conditional Text Speech Sending in menu.c (Edit Box) Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet shows text being sent to the text speech system from an edit box. The call to menu_textspeech_send_text is conditional. ```c char buf_speech[MAX_BUFFER_SPEECH+1]; sprintf (buf_speech,"Edit box: %s",string); #if !defined(__MORPHOS__) menu_textspeech_send_text(buf_speech); #endif ``` -------------------------------- ### SPED52 Editor Mode Keys Source: https://github.com/chernandezba/zesarux/blob/main/src/my_soft/spectrum/sped/sped52en/readmeSPED52.txt Keys available in the SPED52 editor mode after pressing EXTEND mode, CAPS, and SYMBOL on a 48K KB. Some keys have different functions when holding Symbol Shift. ```text A - Page down B - Delete Block C - Copy Block D - Search for Label E - " from start F - Search Text G - " from start N - Find Next text H - HELP!!! (not listed on help - you can sort of see the logic) I - Insert ON/OFF J - Next Label K - Calculate Expression L - Goto line P - Mark start of Block Q - Page up U - Mark end of Block V - Paste Block X - Cut Block Z - Restore Line While holding Symbol Shift: D Delete line I Insert line Q Exit editor ``` -------------------------------- ### Rocman Game Loading Bug Fix Source: https://github.com/chernandezba/zesarux/blob/main/src/docs/load_any_flag.txt This section describes a bug fix for the Rocman game related to tape traps and loading flags. It was present even on ZX Spectrum. ```Assembly ;-copion method: cp a scf ex af,af' di call 0562 f' al entrar: 0100 1001 -Z-- P--C SZ5H3PNC sera Z y Carry? -carga normal F': 0000 0001 ---- ---C -rocman atributos: F': 69 01101001 SZ5H3PNC Z C IX=57FF DE=0301 -al volver de la carga: AF=8f82 AF'=FF69 F=82 1000 0010 S N F'=69 0110 1001 Z5 3 C Z probablemente deba ser 0 Rocman encadena la carga con ese flag Z, y luego falla con mi codigo de trap -rocman bloque siguiente atributos: A9 1010 1001 C ``` -------------------------------- ### Conditional Speech Function Call for ZEsarUX Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet conditionally includes a call to textspeech_send_new_line() based on the __MORPHOS__ preprocessor directive. It's used to manage speech output routines. ```c #if !defined(__MORPHOS__) //Avisar de envio enter especial para rutinas de speech, para que envien sonido textspeech_send_new_line(); + #endif ``` -------------------------------- ### Conditional Text Speech Output in chardetect.c Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This snippet shows how text speech output is conditionally included. It prevents text speech functions from being called when the code is compiled for MorphOS. ```c #if !defined(__MORPHOS__) textspeech_print_speech(buffer); #endif ``` -------------------------------- ### Conditional Speech Output for Active Option Source: https://github.com/chernandezba/zesarux/blob/main/src/patches/morphos_ZEsarUX-4.2/patch.txt This code segment handles speech output for the currently active menu option. It is conditionally compiled to disable speech on MorphOS. ```c #if !defined(__MORPHOS__) menu_textspeech_send_text(texto_opcion_activa); #endif ```